summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2025-01-14 12:00:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 10:02:05 +0100
commit0c246bf6768f4bc87e2737af177ea347d5dda122 (patch)
treed5b0b6454ba3664670d6a86e3604c8e1807d81db /fs
parent70fcb25472d90dd3b87cbee74b9eb68670b0c7b8 (diff)
downloadlinux-0c246bf6768f4bc87e2737af177ea347d5dda122.tar.gz
linux-0c246bf6768f4bc87e2737af177ea347d5dda122.tar.bz2
linux-0c246bf6768f4bc87e2737af177ea347d5dda122.zip
erofs: fix potential return value overflow of z_erofs_shrink_scan()
[ Upstream commit db902986dee453bfb5835cbc8efa67154ab34caf ] z_erofs_shrink_scan() could return small numbers due to the mistyped `freed`. Although I don't think it has any visible impact. Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support") Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20250114040058.459981-1-hsiangkao@linux.alibaba.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/erofs/zdata.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 19ef4ff2a134..f416b73e0ca3 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -927,8 +927,7 @@ unsigned long z_erofs_shrink_scan(struct erofs_sb_info *sbi,
unsigned long nr_shrink)
{
struct z_erofs_pcluster *pcl;
- unsigned int freed = 0;
- unsigned long index;
+ unsigned long index, freed = 0;
xa_lock(&sbi->managed_pslots);
xa_for_each(&sbi->managed_pslots, index, pcl) {