zram: fix NULL check before some freeing functions is not needed
authorTian Tao <tiantao6@hisilicon.com>
Mon, 25 Jan 2021 08:13:01 +0000 (16:13 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Jan 2021 20:12:08 +0000 (13:12 -0700)
fixed the below warning:
/drivers/block/zram/zram_drv.c:534:2-8: WARNING: NULL check
before some freeing functions is not needed.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/zram/zram_drv.c

index d6243db..d701854 100644 (file)
@@ -530,8 +530,7 @@ static ssize_t backing_dev_store(struct device *dev,
 
        return len;
 out:
-       if (bitmap)
-               kvfree(bitmap);
+       kvfree(bitmap);
 
        if (bdev)
                blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL);