mirror of https://gitee.com/openkylin/linux.git
[NET]: Remove redundant NULL checks before [kv]free
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>
This commit is contained in:
parent
40daafc80b
commit
63903ca6af
|
@ -290,11 +290,8 @@ static void ipcomp_free_scratches(void)
|
||||||
if (!scratches)
|
if (!scratches)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for_each_possible_cpu(i) {
|
for_each_possible_cpu(i)
|
||||||
void *scratch = *per_cpu_ptr(scratches, i);
|
vfree(*per_cpu_ptr(scratches, i));
|
||||||
if (scratch)
|
|
||||||
vfree(scratch);
|
|
||||||
}
|
|
||||||
|
|
||||||
free_percpu(scratches);
|
free_percpu(scratches);
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,8 +229,7 @@ static void node_is_down(struct publication *publ)
|
||||||
publ->node, publ->ref, publ->key);
|
publ->node, publ->ref, publ->key);
|
||||||
assert(p == publ);
|
assert(p == publ);
|
||||||
write_unlock_bh(&tipc_nametbl_lock);
|
write_unlock_bh(&tipc_nametbl_lock);
|
||||||
if (publ)
|
kfree(publ);
|
||||||
kfree(publ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue