From: Tim Hansen <devtimhansen@gmail.com>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
alexander.levin@one.verizon.com, devtimhansen@gmail.com
Subject: [PATCH] block/bio: Remove null checks before mempool_destroy in bioset_free
Date: Fri, 6 Oct 2017 14:45:13 -0400 [thread overview]
Message-ID: <20171006184513.GA78611@debian> (raw)
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
next reply other threads:[~2017-10-06 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 18:45 Tim Hansen [this message]
2017-10-06 19:05 ` [PATCH] block/bio: Remove null checks before mempool_destroy in bioset_free Jens Axboe
2017-10-06 22:30 ` Tim Hansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171006184513.GA78611@debian \
--to=devtimhansen@gmail.com \
--cc=alexander.levin@one.verizon.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox