From nobody Thu Dec 18 01:57:12 2025 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 826F542A83 for ; Tue, 14 Jan 2025 04:01:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736827269; cv=none; b=LoIPlA6XrD89YmGRYTrzCoyZsJf2xNyabubnkOquwfAHA6dTnUk5KAwz+x08m5swqQXIuXslAFtBjSOBaiMCdYtZu2kXU3EPJ9qzFrd4ONYSvFH/SSt2mc/fPU7oBPGbz2rX+mailQJs3PGbB4j8PtbV13RwWpVIkel99eZvB4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736827269; c=relaxed/simple; bh=YK8a9xv9tvkNtTBogUDLSpdvtOvhTvtRIQ9pyw8nKV4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NrK16XkIVresRBMy1TEBRqqnLGODj8SEM83D+9MRn1BR7tfGnzTZ56T6PQ0c1XIZZ7U1lIdrhd+1fhi1RFriV4WoTKAHgHYw1tH5WYvaIy6zpH8Dg4zErMGNf+XLgSTbTU68BJlxVTZ/Z81KgfzSvu3xL3kg7sBF6aN14swX/14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=xy78/SqN; arc=none smtp.client-ip=115.124.30.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="xy78/SqN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1736827263; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=bX6y3x4nFZgjceOhg17WaZOQnJzQdWpX26Z6BWbAHNg=; b=xy78/SqN7/GzNlFSQ2aMLdmcU70LYdVvKQworWX8zLjrQSgcxSIN2sX5S+2AM1HH9G0+/aeh7P34UNLISo4XkZDn8vP43Q6x8za3FKEBauJFoVVzdcJXvKQjjcPgPjz0iClAKxyeGyVN0InRnMOSc0O0eIq/oxNl0re+xg3mbYc= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WNdqtDg_1736827258 cluster:ay36) by smtp.aliyun-inc.com; Tue, 14 Jan 2025 12:01:03 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: LKML , Gao Xiang Subject: [PATCH] erofs: fix potential return value overflow of z_erofs_shrink_scan() Date: Tue, 14 Jan 2025 12:00:58 +0800 Message-ID: <20250114040058.459981-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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") Signed-off-by: Gao Xiang Reviewed-by: Chao Yu --- fs/erofs/zdata.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 8bafc4d9edbe..057d68eaa5d2 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -915,8 +915,7 @@ unsigned long z_erofs_shrink_scan(struct erofs_sb_info = *sbi, unsigned long nr_shrink) { struct z_erofs_pcluster *pcl; - unsigned int freed =3D 0; - unsigned long index; + unsigned long index, freed =3D 0; =20 xa_lock(&sbi->managed_pslots); xa_for_each(&sbi->managed_pslots, index, pcl) { --=20 2.43.5