From: Tian Tao Date: Sun, 14 Feb 2021 10:31:02 +0000 (+0000) Subject: lightnvm: fix unnecessary NULL check warnings X-Git-Tag: for-5.12/drivers-2021-02-17~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4cf29e43afc0dea7ccf6b09a20bd598fad47bf60;p=linux-2.6-block.git lightnvm: fix unnecessary NULL check warnings Remove NULL checks before vfree() to fix these warnings: ./drivers/lightnvm/pblk-gc.c:27:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Tian Tao Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe --- diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c index 2581eebcfc41..b31658be35a7 100644 --- a/drivers/lightnvm/pblk-gc.c +++ b/drivers/lightnvm/pblk-gc.c @@ -23,8 +23,7 @@ static void pblk_gc_free_gc_rq(struct pblk_gc_rq *gc_rq) { - if (gc_rq->data) - vfree(gc_rq->data); + vfree(gc_rq->data); kfree(gc_rq); }