diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-09-13 14:15:10 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-10-02 17:23:44 +1000 |
commit | 644df1a85fc4b0c7a16800f55717261546f4e651 (patch) | |
tree | 30ed717350163c534c5923d0557f5dafa4a43053 /drivers/md/raid1.c | |
parent | d4929add83ad4660b1824a9282ab5dd4d60140fa (diff) |
md: 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);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 4517f06c41ba..5f4f5536f66f 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2843,8 +2843,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) abort: if (conf) { - if (conf->r1bio_pool) - mempool_destroy(conf->r1bio_pool); + mempool_destroy(conf->r1bio_pool); kfree(conf->mirrors); safe_put_page(conf->tmppage); kfree(conf->poolinfo); @@ -2946,8 +2945,7 @@ static void raid1_free(struct mddev *mddev, void *priv) { struct r1conf *conf = priv; - if (conf->r1bio_pool) - mempool_destroy(conf->r1bio_pool); + mempool_destroy(conf->r1bio_pool); kfree(conf->mirrors); safe_put_page(conf->tmppage); kfree(conf->poolinfo); |