block: remove unnecessary NULL checks in bioset_integrity_free()
authorTim Hansen <[email protected]>
Thu, 5 Oct 2017 18:09:20 +0000 (14:09 -0400)
committerJens Axboe <[email protected]>
Fri, 6 Oct 2017 19:03:12 +0000 (13:03 -0600)
mempool_destroy() already checks for a NULL value being passed in, this
eliminates duplicate checks.

This was caught by running make coccicheck M=block/ on linus' tree on
commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this
patch).

Reviewed-by: Kyle Fortin <[email protected]>
Acked-by: Martin K. Petersen <[email protected]>
Signed-off-by: Tim Hansen <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
block/bio-integrity.c

index 5df32907ff3bf8f7219f7518edbfe05850f46ea1..23b42e8aa03e7b327bc538350b91d41e880e5d45 100644 (file)
@@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create);
 
 void bioset_integrity_free(struct bio_set *bs)
 {
-       if (bs->bio_integrity_pool)
-               mempool_destroy(bs->bio_integrity_pool);
-
-       if (bs->bvec_integrity_pool)
-               mempool_destroy(bs->bvec_integrity_pool);
+       mempool_destroy(bs->bio_integrity_pool);
+       mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);