]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/tipc/port.c
[PATCH] zd1211rw: Pass more management frame types up to host
[linux-2.6-omap-h63xx.git] / net / tipc / port.c
index 47d97404e3ee06a3de6d9f2721af8211a78fd8d3..b9c8c6b9e94fdf87c931cdc3c409a373a8043bdc 100644 (file)
@@ -57,8 +57,8 @@
 static struct sk_buff *msg_queue_head = NULL;
 static struct sk_buff *msg_queue_tail = NULL;
 
-spinlock_t tipc_port_list_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t queue_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(tipc_port_list_lock);
+static DEFINE_SPINLOCK(queue_lock);
 
 static LIST_HEAD(ports);
 static void port_handle_node_down(unsigned long ref);
@@ -226,12 +226,11 @@ u32 tipc_createport_raw(void *usr_handle,
        struct tipc_msg *msg;
        u32 ref;
 
-       p_ptr = kmalloc(sizeof(*p_ptr), GFP_ATOMIC);
+       p_ptr = kzalloc(sizeof(*p_ptr), GFP_ATOMIC);
        if (!p_ptr) {
                warn("Port creation failed, no memory\n");
                return 0;
        }
-       memset(p_ptr, 0, sizeof(*p_ptr));
        ref = tipc_ref_acquire(p_ptr, &p_ptr->publ.lock);
        if (!ref) {
                warn("Port creation failed, reference table exhausted\n");
@@ -1058,7 +1057,7 @@ int tipc_createport(u32 user_ref,
        struct port *p_ptr; 
        u32 ref;
 
-       up_ptr = (struct user_port *)kmalloc(sizeof(*up_ptr), GFP_ATOMIC);
+       up_ptr = kmalloc(sizeof(*up_ptr), GFP_ATOMIC);
        if (!up_ptr) {
                warn("Port creation failed, no memory\n");
                return -ENOMEM;