diff options
author | Chengguang Xu <cgxu519@gmx.com> | 2018-11-14 07:33:09 +0800 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2018-12-20 08:53:24 -0800 |
commit | 37b22c28946046e587c12b2b5bdaba7062e23f75 (patch) | |
tree | a56b3806721628ea989eb9ab7a07fc01a0a18319 /drivers/md | |
parent | be85f93ae2df32dea0b20908316f1d894c3e0f64 (diff) | |
download | blackbird-op-linux-37b22c28946046e587c12b2b5bdaba7062e23f75.tar.gz blackbird-op-linux-37b22c28946046e587c12b2b5bdaba7062e23f75.zip |
md: remvoe redundant condition check
mempool_destroy() can handle NULL pointer correctly,
so there is no need to check NULL pointer before calling
mempool_destroy().
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 69778419aa20..4f9b5827355e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5692,14 +5692,10 @@ int md_run(struct mddev *mddev) return 0; abort: - if (mddev->flush_bio_pool) { - mempool_destroy(mddev->flush_bio_pool); - mddev->flush_bio_pool = NULL; - } - if (mddev->flush_pool){ - mempool_destroy(mddev->flush_pool); - mddev->flush_pool = NULL; - } + mempool_destroy(mddev->flush_bio_pool); + mddev->flush_bio_pool = NULL; + mempool_destroy(mddev->flush_pool); + mddev->flush_pool = NULL; return err; } |