All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] zram: remove redundant NULL check
@ 2021-01-27  9:32 Abaci Team
  2021-01-27 16:34 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Abaci Team @ 2021-01-27  9:32 UTC (permalink / raw
  To: axboe
  Cc: minchan, ngupta, sergey.senozhatsky.work, linux-kernel,
	linux-block, Abaci Team

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@linux.alibaba.com>
Suggested-by: Yang Li <oswb@linux.alibaba.com>
Signed-off-by: Abaci Team <abaci-bugfix@linux.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] zram: remove redundant NULL check
  2021-01-27  9:32 [PATCH] zram: remove redundant NULL check Abaci Team
@ 2021-01-27 16:34 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-01-27 16:34 UTC (permalink / raw
  To: Abaci Team
  Cc: minchan, ngupta, sergey.senozhatsky.work, linux-kernel,
	linux-block

On 1/27/21 2:32 AM, Abaci Team wrote:
> 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.

Already fixed/queued for 5.12:

https://git.kernel.dk/cgit/linux-block/commit/?h=for-5.12/drivers&id=294ed6b9f00665acc22253044890257c5d9d18c1

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-27 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-27  9:32 [PATCH] zram: remove redundant NULL check Abaci Team
2021-01-27 16:34 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.