public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block/bio: Remove null checks before mempool_destroy in bioset_free
@ 2017-10-06 18:45 Tim Hansen
  2017-10-06 19:05 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Hansen @ 2017-10-06 18:45 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, alexander.levin, devtimhansen

This patch removes redundant checks for null values on bio_pool and bvec_pool.

Found using make coccicheck M=block/ on linux-net tree on the next-20170929 tag.

Related to patch 9987695 that removed similar checks in bio-integrity. 

Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
---
 block/bio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 8338304..bf0dbe8 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1928,11 +1928,8 @@ void bioset_free(struct bio_set *bs)
 	if (bs->rescue_workqueue)
 		destroy_workqueue(bs->rescue_workqueue);
 
-	if (bs->bio_pool)
-		mempool_destroy(bs->bio_pool);
-
-	if (bs->bvec_pool)
-		mempool_destroy(bs->bvec_pool);
+	mempool_destroy(bs->bio_pool);
+	mempool_destroy(bs->bvec_pool);
 
 	bioset_integrity_free(bs);
 	bio_put_slab(bs);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-06 22:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-06 18:45 [PATCH] block/bio: Remove null checks before mempool_destroy in bioset_free Tim Hansen
2017-10-06 19:05 ` Jens Axboe
2017-10-06 22:30   ` Tim Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox