]> err.no Git - linux-2.6/blobdiff - net/tipc/port.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
[linux-2.6] / net / tipc / port.c
index 360920b3d821be3a711c9710c59d3ae99d223a99..47d97404e3ee06a3de6d9f2721af8211a78fd8d3 100644 (file)
@@ -168,7 +168,6 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp)
        struct port_list *item = dp;
        int cnt = 0;
 
-       assert(buf);
        msg = buf_msg(buf);
 
        /* Create destination port list, if one wasn't supplied */
@@ -196,7 +195,7 @@ void tipc_port_recv_mcast(struct sk_buff *buf, struct port_list *dp)
                        struct sk_buff *b = skb_clone(buf, GFP_ATOMIC);
 
                        if (b == NULL) {
-                               warn("Buffer allocation failure\n");
+                               warn("Unable to deliver multicast message(s)\n");
                                msg_dbg(msg, "LOST:");
                                goto exit;
                        }
@@ -228,14 +227,14 @@ u32 tipc_createport_raw(void *usr_handle,
        u32 ref;
 
        p_ptr = kmalloc(sizeof(*p_ptr), GFP_ATOMIC);
-       if (p_ptr == NULL) {
-               warn("Memory squeeze; failed to create port\n");
+       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("Reference Table Exhausted\n");
+               warn("Port creation failed, reference table exhausted\n");
                kfree(p_ptr);
                return 0;
        }
@@ -1060,7 +1059,8 @@ int tipc_createport(u32 user_ref,
        u32 ref;
 
        up_ptr = (struct user_port *)kmalloc(sizeof(*up_ptr), GFP_ATOMIC);
-       if (up_ptr == NULL) {
+       if (!up_ptr) {
+               warn("Port creation failed, no memory\n");
                return -ENOMEM;
        }
        ref = tipc_createport_raw(NULL, port_dispatcher, port_wakeup, importance);
@@ -1171,8 +1171,6 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
        p_ptr = tipc_port_lock(ref);
        if (!p_ptr)
                return -EINVAL;
-       if (!p_ptr->publ.published)
-               goto exit;
        if (!seq) {
                list_for_each_entry_safe(publ, tpubl, 
                                         &p_ptr->publications, pport_list) {
@@ -1199,7 +1197,6 @@ int tipc_withdraw(u32 ref, unsigned int scope, struct tipc_name_seq const *seq)
        }
        if (list_empty(&p_ptr->publications))
                p_ptr->publ.published = 0;
-exit:
        tipc_port_unlock(p_ptr);
        return res;
 }