[PATCH] zram: remove unreachable kernel_read_file_from_path() return check
From: Sergey Senozhatsky
Date: Tue Sep 01 2026 - 01:13:50 EST
Sashiko reported that:
kernel_read_file_from_path() returns negative error for zero-sized
files, so we cannot have "sz == 0" return, remove it and use a
generic error message instead.
Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
---
drivers/block/zram/zram_drv.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index a9b3bb1d3bef..809284aee124 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1717,11 +1717,6 @@ static int comp_params_store(struct zram *zram, u32 prio, s32 level,
dict_path, sz);
return sz;
}
- if (sz == 0) {
- pr_err("failed to load dictionary %s (empty file)\n",
- dict_path);
- return -EINVAL;
- }
}
zram->params[prio].dict_sz = sz;
--
2.55.0.897.gb25b4bd76c-goog