nfsd: drop null test before destroy functions
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 13 Sep 2015 12:15:15 +0000 (14:15 +0200)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 12 Oct 2015 21:31:04 +0000 (17:31 -0400)
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>
fs/nfsd/nfscache.c

index 46ec934f5dee8c529020558bed4cd820956734f1..116940c739e1c9487e183e24481dfa7a52e2ffb7 100644 (file)
@@ -217,10 +217,8 @@ void nfsd_reply_cache_shutdown(void)
        drc_hashtbl = NULL;
        drc_hashsize = 0;
 
-       if (drc_slab) {
-               kmem_cache_destroy(drc_slab);
-               drc_slab = NULL;
-       }
+       kmem_cache_destroy(drc_slab);
+       drc_slab = NULL;
 }
 
 /*