diff mbox series

zram: fix NULL check before some freeing functions is not needed

Message ID 1611562381-14985-1-git-send-email-tiantao6@hisilicon.com (mailing list archive)
State New, archived
Headers show
Series zram: fix NULL check before some freeing functions is not needed | expand

Commit Message

Tian Tao Jan. 25, 2021, 8:13 a.m. UTC
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>
---
 drivers/block/zram/zram_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jens Axboe Jan. 26, 2021, 8:12 p.m. UTC | #1
On 1/25/21 1:13 AM, Tian Tao wrote:
> fixed the below warning:
> /drivers/block/zram/zram_drv.c:534:2-8: WARNING: NULL check
> before some freeing functions is not needed.

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index e2933cb..92739b9 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);