summaryrefslogtreecommitdiffstats
path: root/drivers/block/zram
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-01-25 09:13:01 +0100
committerJens Axboe <axboe@kernel.dk>2021-01-26 21:12:08 +0100
commit294ed6b9f00665acc22253044890257c5d9d18c1 (patch)
tree815c33616acdab17be917524db13242ee2d8edc0 /drivers/block/zram
parentdrbd: remove unused argument from drbd_request_prepare and __drbd_make_request (diff)
downloadlinux-294ed6b9f00665acc22253044890257c5d9d18c1.tar.xz
linux-294ed6b9f00665acc22253044890257c5d9d18c1.zip
zram: fix NULL check before some freeing functions is not needed
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>
Diffstat (limited to 'drivers/block/zram')
-rw-r--r--drivers/block/zram/zram_drv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index d6243dbc53cc..d7018543842e 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -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);