Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / net / ax25 / af_ax25.c
index 000695c..a2e0dd0 100644 (file)
@@ -13,6 +13,7 @@
  * Copyright (C) Hans Alblas PE1AYX (hans@esrac.ele.tue.nl)
  * Copyright (C) Frederic Rible F1OAT (frible@teaser.fr)
  */
+#include <linux/config.h>
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/errno.h>
@@ -145,7 +146,7 @@ struct sock *ax25_find_listener(ax25_address *addr, int digi,
        ax25_cb *s;
        struct hlist_node *node;
 
-       spin_lock(&ax25_list_lock);
+       spin_lock_bh(&ax25_list_lock);
        ax25_for_each(s, node, &ax25_list) {
                if ((s->iamdigi && !digi) || (!s->iamdigi && digi))
                        continue;
@@ -154,12 +155,12 @@ struct sock *ax25_find_listener(ax25_address *addr, int digi,
                        /* If device is null we match any device */
                        if (s->ax25_dev == NULL || s->ax25_dev->dev == dev) {
                                sock_hold(s->sk);
-                               spin_unlock(&ax25_list_lock);
+                               spin_unlock_bh(&ax25_list_lock);
                                return s->sk;
                        }
                }
        }
-       spin_unlock(&ax25_list_lock);
+       spin_unlock_bh(&ax25_list_lock);
 
        return NULL;
 }
@@ -174,7 +175,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
        ax25_cb *s;
        struct hlist_node *node;
 
-       spin_lock(&ax25_list_lock);
+       spin_lock_bh(&ax25_list_lock);
        ax25_for_each(s, node, &ax25_list) {
                if (s->sk && !ax25cmp(&s->source_addr, my_addr) &&
                    !ax25cmp(&s->dest_addr, dest_addr) &&
@@ -185,7 +186,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
                }
        }
 
-       spin_unlock(&ax25_list_lock);
+       spin_unlock_bh(&ax25_list_lock);
 
        return sk;
 }
@@ -235,7 +236,7 @@ void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
        struct sk_buff *copy;
        struct hlist_node *node;
 
-       spin_lock(&ax25_list_lock);
+       spin_lock_bh(&ax25_list_lock);
        ax25_for_each(s, node, &ax25_list) {
                if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 &&
                    s->sk->sk_type == SOCK_RAW &&
@@ -248,7 +249,7 @@ void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
                                kfree_skb(copy);
                }
        }
-       spin_unlock(&ax25_list_lock);
+       spin_unlock_bh(&ax25_list_lock);
 }
 
 /*
@@ -486,9 +487,10 @@ ax25_cb *ax25_create_cb(void)
 {
        ax25_cb *ax25;
 
-       if ((ax25 = kzalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL)
+       if ((ax25 = kmalloc(sizeof(*ax25), GFP_ATOMIC)) == NULL)
                return NULL;
 
+       memset(ax25, 0x00, sizeof(*ax25));
        atomic_set(&ax25->refcount, 1);
 
        skb_queue_head_init(&ax25->write_queue);