Skip to content

Commit

Permalink
nfsd: drop null test before destroy functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and J. Bruce Fields committed Oct 12, 2015
1 parent 35a92fe commit e79017d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/nfsd/nfscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit e79017d

Please sign in to comment.