[NET]: Remove redundant NULL checks before [kv]free
Jesper Juhl [Tue, 18 Apr 2006 21:51:44 +0000 (14:51 -0700)]
Redundant NULL check before kfree removal
from net/

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

net/ipv4/ipcomp.c
net/tipc/name_distr.c

index 04a4294..cd810f4 100644 (file)
@@ -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);
 }
index 953307a..a3bbc89 100644 (file)
@@ -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);
 }
 
 /**