diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2021-01-25 11:13:01 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-01-26 23:12:08 +0300 |
commit | 294ed6b9f00665acc22253044890257c5d9d18c1 (patch) | |
tree | 815c33616acdab17be917524db13242ee2d8edc0 /drivers/block/zram | |
parent | 370276bac8ec6f74fb52a518ef05aa84d1059067 (diff) | |
download | linux-294ed6b9f00665acc22253044890257c5d9d18c1.tar.xz |
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.c | 3 |
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); |