Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfsd: drop null test before destroy functions

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
\(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Julia Lawall and committed by
J. Bruce Fields
e79017dd 35a92fe8

+2 -4
+2 -4
fs/nfsd/nfscache.c
··· 217 217 drc_hashtbl = NULL; 218 218 drc_hashsize = 0; 219 219 220 - if (drc_slab) { 221 - kmem_cache_destroy(drc_slab); 222 - drc_slab = NULL; 223 - } 220 + kmem_cache_destroy(drc_slab); 221 + drc_slab = NULL; 224 222 } 225 223 226 224 /*