Skip to contentSkip to conversation

drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy

PATCH Applied zhong jiang 2 participants 2 messages Aug 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy

mempool_destroy has taken the null pointer into account. So it is safe to remove the null check.

---
 drivers/block/aoe/aoedev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/aoe/aoedev.c +2 -2
index 697f735..41060e9 100644
@@ -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);
 
Signature · 1 line
1.7.12.4
maintainer Applied
#1 lore raw
Quoted 2 lines · zhong jiang

mempool_destroy has taken the null pointer into account. So it is safe to remove the null check.

Applied, thanks.

Signature · 1 line
Jens Axboe