mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH next] zram: Fix uninitialized variable in zram_writeback_slots()
@ 2025-04-09 10:58 Dan Carpenter
  2025-04-09 11:10 ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-04-09 10:58 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Minchan Kim, Jens Axboe, Andrew Morton, Brian Geffon,
	linux-kernel, linux-block, kernel-janitors

The "ret" variable is only initialized on errors and not on success.
Initialize it to zero.

Fixes: 4529d2d13fd1 ("zram: modernize writeback interface")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/block/zram/zram_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 2133488dbfd4..94e6e9b80bf0 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -741,7 +741,7 @@ static int zram_writeback_slots(struct zram *zram, struct zram_pp_ctl *ctl)
 	struct zram_pp_slot *pps;
 	struct bio_vec bio_vec;
 	struct bio bio;
-	int ret, err;
+	int ret = 0, err;
 	u32 index;
 
 	page = alloc_page(GFP_KERNEL);
-- 
2.47.2


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

end of thread, other threads:[~2025-04-09 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-09 10:58 [PATCH next] zram: Fix uninitialized variable in zram_writeback_slots() Dan Carpenter
2025-04-09 11:10 ` Sergey Senozhatsky
2025-04-09 11:12   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®