lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1611739922-3365-1-git-send-email-abaci-bugfix@linux.alibaba.com>
Date:   Wed, 27 Jan 2021 17:32:02 +0800
From:   Abaci Team <abaci-bugfix@...ux.alibaba.com>
To:     axboe@...nel.dk
Cc:     minchan@...nel.org, ngupta@...are.org,
        sergey.senozhatsky.work@...il.com, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org,
        Abaci Team <abaci-bugfix@...ux.alibaba.com>
Subject: [PATCH] zram: remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/block/zram/zram_drv.c:534:2-8: WARNING: NULL check before some
freeing functions is not needed.

Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Suggested-by: Yang Li <oswb@...ux.alibaba.com>
Signed-off-by: Abaci Team <abaci-bugfix@...ux.alibaba.com>
---
 drivers/block/zram/zram_drv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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);
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ