* [PATCH] drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy
@ 2018-08-08 15:00 zhong jiang
2018-08-08 15:17 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-08-08 15:00 UTC (permalink / raw)
To: axboe, ed.cashin; +Cc: linux-kernel
mempool_destroy has taken the null pointer into account. So it is safe
to remove the null check.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/block/aoe/aoedev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 697f735..41060e9 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -284,8 +284,8 @@
e = t + d->ntargets;
for (; t < e && *t; t++)
freetgt(d, *t);
- if (d->bufpool)
- mempool_destroy(d->bufpool);
+
+ mempool_destroy(d->bufpool);
skbpoolfree(d);
minor_free(d->sysminor);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy
2018-08-08 15:00 [PATCH] drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy zhong jiang
@ 2018-08-08 15:17 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-08-08 15:17 UTC (permalink / raw)
To: zhong jiang, ed.cashin; +Cc: linux-kernel
On 8/8/18 9:00 AM, zhong jiang wrote:
> mempool_destroy has taken the null pointer into account. So it is safe
> to remove the null check.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-08 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 15:00 [PATCH] drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy zhong jiang
2018-08-08 15:17 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).