* [PATCH] zram: fix NULL check before some freeing functions is not needed
@ 2021-01-25 8:13 Tian Tao
2021-01-25 20:09 ` Minchan Kim
2021-01-26 20:12 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2021-01-25 8:13 UTC (permalink / raw)
To: minchan, ngupta, sergey.senozhatsky.work, axboe; +Cc: linux-block
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(-)
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);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] zram: fix NULL check before some freeing functions is not needed
2021-01-25 8:13 [PATCH] zram: fix NULL check before some freeing functions is not needed Tian Tao
@ 2021-01-25 20:09 ` Minchan Kim
2021-01-26 20:12 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Minchan Kim @ 2021-01-25 20:09 UTC (permalink / raw)
To: Tian Tao, Andrew Morton
Cc: ngupta, sergey.senozhatsky.work, axboe, linux-block
On Mon, Jan 25, 2021 at 04:13:01PM +0800, 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.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] zram: fix NULL check before some freeing functions is not needed
2021-01-25 8:13 [PATCH] zram: fix NULL check before some freeing functions is not needed Tian Tao
2021-01-25 20:09 ` Minchan Kim
@ 2021-01-26 20:12 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-01-26 20:12 UTC (permalink / raw)
To: Tian Tao, minchan, ngupta, sergey.senozhatsky.work; +Cc: linux-block
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.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-26 22:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 8:13 [PATCH] zram: fix NULL check before some freeing functions is not needed Tian Tao
2021-01-25 20:09 ` Minchan Kim
2021-01-26 20:12 ` 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.