]> Git Repo - linux.git/commitdiff
md: remvoe redundant condition check
authorChengguang Xu <[email protected]>
Tue, 13 Nov 2018 23:33:09 +0000 (07:33 +0800)
committerShaohua Li <[email protected]>
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 <[email protected]>
Signed-off-by: Shaohua Li <[email protected]>
drivers/md/md.c

index 69778419aa207f90ecb3b68e79bd121c633a28dd..4f9b5827355e51de20bd78e86212da00d9b51d3b 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;
 }
This page took 0.103617 seconds and 4 git commands to generate.