Skip to content

Commit

Permalink
lightnvm: fix unnecessary NULL check warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Matias Bjørling <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Tian Tao authored and axboe committed Feb 15, 2021
1 parent 65fb1b0 commit 4cf29e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/lightnvm/pblk-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4cf29e4

Please sign in to comment.