[PATCH] zram: we should always zero out err variable in recompress loop

Sergey Senozhatsky
2022-11-10T14:34:38Z

Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.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 171eccc2249d..9d33801e8ba8 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1891,7 +1891,7 @@ static ssize_t recompress_store(struct device *dev,

ret = len;
for (index = 0; index < nr_pages; index++) {
- int err;
+ int err = 0;

zram_slot_lock(zram, index);

--
2.38.1.431.g37b22c650d-goog