drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy
authorzhong jiang <zhongjiang@huawei.com>
Wed, 8 Aug 2018 15:00:35 +0000 (23:00 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 8 Aug 2018 15:17:20 +0000 (09:17 -0600)
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/aoe/aoedev.c

index 697f735b07a435da967332511f9673258e6eee88..41060e9cedf20c882816c1c83ca21e15512152a2 100644 (file)
@@ -284,8 +284,8 @@ freedev(struct aoedev *d)
        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);