Skip to content

Commit

Permalink
[NET]: Remove redundant NULL checks before [kv]free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesper Juhl authored and David S. Miller committed Apr 18, 2006
1 parent 40daafc commit 63903ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions net/ipv4/ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions net/tipc/name_distr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 63903ca

Please sign in to comment.