From: Jesper Juhl Date: Tue, 18 Apr 2006 21:51:44 +0000 (-0700) Subject: [NET]: Remove redundant NULL checks before [kv]free X-Git-Tag: v2.6.17-rc2~2^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=63903ca6af3d9424a0c2b176f927fa7e7ab2ae8e;p=linux-2.6-omap-h63xx.git [NET]: Remove redundant NULL checks before [kv]free Redundant NULL check before kfree removal from net/ Signed-off-by: Jesper Juhl Acked-by: James Morris Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index 04a42946566..cd810f41af1 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c @@ -290,11 +290,8 @@ static void ipcomp_free_scratches(void) if (!scratches) return; - for_each_possible_cpu(i) { - void *scratch = *per_cpu_ptr(scratches, i); - if (scratch) - vfree(scratch); - } + for_each_possible_cpu(i) + vfree(*per_cpu_ptr(scratches, i)); free_percpu(scratches); } diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 953307a9df1..a3bbc891f95 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -229,8 +229,7 @@ static void node_is_down(struct publication *publ) publ->node, publ->ref, publ->key); assert(p == publ); write_unlock_bh(&tipc_nametbl_lock); - if (publ) - kfree(publ); + kfree(publ); } /**