From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:30 +0000 (+0000) Subject: tipc: remove pointless check for NULL prior to kfree X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~23678^2~50 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e83504f72456809cdbdbc91700d3ba6370c9da1c;p=mirror_ubuntu-focal-kernel.git tipc: remove pointless check for NULL prior to kfree It is acceptable to call kfree() with NULL, so these checks are not serving any useful purpose. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 376a30b9fd72..a6c989fd4988 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -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); } /** diff --git a/net/tipc/port.c b/net/tipc/port.c index 8bacd572a9fb..db14b7e0afdc 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c @@ -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);