]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lightnvm: fix unnecessary NULL check warnings
authorTian Tao <tiantao6@hisilicon.com>
Sun, 14 Feb 2021 10:31:02 +0000 (10:31 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Feb 2021 04:27:24 +0000 (21:27 -0700)
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 <tiantao6@hisilicon.com>
Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-gc.c

index 2581eebcfc41d5d4363a62ba457fae15152d3090..b31658be35a7bb72e890333fa4b0f327c87abd0a 100644 (file)
@@ -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);
 }