* [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
* Re: [PATCH next] zram: Fix uninitialized variable in zram_writeback_slots()
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
0 siblings, 1 reply; 3+ messages in thread
From: Sergey Senozhatsky @ 2025-04-09 11:10 UTC (permalink / raw)
To: Dan Carpenter, Andrew Morton
Cc: Sergey Senozhatsky, Minchan Kim, Jens Axboe, Brian Geffon,
linux-kernel, linux-block, kernel-janitors
On (25/04/09 13:58), Dan Carpenter wrote:
> The "ret" variable is only initialized on errors and not on success.
> Initialize it to zero.
Thank you Dan.
> Fixes: 4529d2d13fd1 ("zram: modernize writeback interface")
This is still in mm-unstable, mind if we fold the fix in?
Or I can send a v4 with the fix applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH next] zram: Fix uninitialized variable in zram_writeback_slots()
2025-04-09 11:10 ` Sergey Senozhatsky
@ 2025-04-09 11:12 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-04-09 11:12 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Andrew Morton, Minchan Kim, Jens Axboe, Brian Geffon,
linux-kernel, linux-block, kernel-janitors
On Wed, Apr 09, 2025 at 08:10:22PM +0900, Sergey Senozhatsky wrote:
> On (25/04/09 13:58), Dan Carpenter wrote:
> > The "ret" variable is only initialized on errors and not on success.
> > Initialize it to zero.
>
> Thank you Dan.
>
> > Fixes: 4529d2d13fd1 ("zram: modernize writeback interface")
>
> This is still in mm-unstable, mind if we fold the fix in?
> Or I can send a v4 with the fix applied.
No, problem. I understand how mm works.
regards,
dan carpenter
^ 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®