]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
tipc: remove pointless check for NULL prior to kfree
authorAllan Stephens <Allan.Stephens@windriver.com>
Fri, 31 Dec 2010 18:59:30 +0000 (18:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 1 Jan 2011 21:57:55 +0000 (13:57 -0800)
It is acceptable to call kfree() with NULL, so these checks are not
serving any useful purpose.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/name_distr.c
net/tipc/port.c

index 376a30b9fd72e0511c07c58e0aff6dfb52aad0c1..a6c989fd4988e198d2217e1ac61a01a15cf93348 100644 (file)
@@ -240,9 +240,7 @@ static void node_is_down(struct publication *publ)
                    publ->type, publ->lower, publ->node, publ->ref, publ->key);
        }
 
-       if (p) {
-               kfree(p);
-       }
+       kfree(p);
 }
 
 /**
index 8bacd572a9fbb31d6d9e145a0b5e23e87f913dc4..db14b7e0afdc308be369e8ca85b33fc748a74f5c 100644 (file)
@@ -269,9 +269,7 @@ int tipc_deleteport(u32 ref)
                buf = port_build_peer_abort_msg(p_ptr, TIPC_ERR_NO_PORT);
                tipc_nodesub_unsubscribe(&p_ptr->subscription);
        }
-       if (p_ptr->user_port) {
-               kfree(p_ptr->user_port);
-       }
+       kfree(p_ptr->user_port);
 
        spin_lock_bh(&tipc_port_list_lock);
        list_del(&p_ptr->port_list);