ipv6: fix an oops when force unload ipv6 module
[safe/jmp/linux-2.6] / net / irda / irttp.c
index 74e439e..9cb79f9 100644 (file)
@@ -201,7 +201,7 @@ static void irttp_todo_expired(unsigned long data)
  *
  *     Flushes (removes all frames) in transitt-buffer (tx_list)
  */
-void irttp_flush_queues(struct tsap_cb *self)
+static void irttp_flush_queues(struct tsap_cb *self)
 {
        struct sk_buff* skb;
 
@@ -1266,9 +1266,9 @@ static void irttp_connect_confirm(void *instance, void *sap,
  *    Some other device is connecting to this TSAP
  *
  */
-void irttp_connect_indication(void *instance, void *sap, struct qos_info *qos,
-                             __u32 max_seg_size, __u8 max_header_size,
-                             struct sk_buff *skb)
+static void irttp_connect_indication(void *instance, void *sap,
+               struct qos_info *qos, __u32 max_seg_size, __u8 max_header_size,
+               struct sk_buff *skb)
 {
        struct tsap_cb *self;
        struct lsap_cb *lsap;
@@ -1453,6 +1453,7 @@ struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)
        }
        /* Dup */
        memcpy(new, orig, sizeof(struct tsap_cb));
+       spin_lock_init(&new->lock);
 
        /* We don't need the old instance any more */
        spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);
@@ -1579,8 +1580,8 @@ EXPORT_SYMBOL(irttp_disconnect_request);
  *    Disconnect indication, TSAP disconnected by peer?
  *
  */
-void irttp_disconnect_indication(void *instance, void *sap, LM_REASON reason,
-                                struct sk_buff *skb)
+static void irttp_disconnect_indication(void *instance, void *sap,
+               LM_REASON reason, struct sk_buff *skb)
 {
        struct tsap_cb *self;
 
@@ -1664,7 +1665,7 @@ static void irttp_do_data_indication(struct tsap_cb *self, struct sk_buff *skb)
  *     Check if we have any frames to be transmitted, or if we have any
  *     available credit to give away.
  */
-void irttp_run_rx_queue(struct tsap_cb *self)
+static void irttp_run_rx_queue(struct tsap_cb *self)
 {
        struct sk_buff *skb;
        int more = 0;