diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-09-13 14:15:26 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-11-02 23:36:47 +0100 |
commit | 13bf283408077931ace05449de92c68c1cb55120 (patch) | |
tree | f7bb252e25cb3da43f0f3cb611d0aba2d94b3de5 /drivers/block/rbd.c | |
parent | 6a13feb9c82803e2b815eca72fa7a9f5561d7861 (diff) | |
download | blackbird-op-linux-13bf283408077931ace05449de92c68c1cb55120.tar.gz blackbird-op-linux-13bf283408077931ace05449de92c68c1cb55120.zip |
rbd: 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: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 128e7df5b807..8f3dcb66c8ba 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -5663,10 +5663,8 @@ static int rbd_slab_init(void) if (rbd_segment_name_cache) return 0; out_err: - if (rbd_obj_request_cache) { - kmem_cache_destroy(rbd_obj_request_cache); - rbd_obj_request_cache = NULL; - } + kmem_cache_destroy(rbd_obj_request_cache); + rbd_obj_request_cache = NULL; kmem_cache_destroy(rbd_img_request_cache); rbd_img_request_cache = NULL; |