md: remvoe redundant condition check
authorChengguang Xu <cgxu519@gmx.com>
Tue, 13 Nov 2018 23:33:09 +0000 (07:33 +0800)
committerShaohua Li <shli@fb.com>
Thu, 20 Dec 2018 16:53:24 +0000 (08:53 -0800)
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>
drivers/md/md.c

index 6977841..4f9b582 100644 (file)
@@ -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;
 }