summaryrefslogtreecommitdiff
path: root/fs/exfat
diff options
context:
space:
mode:
authorPhilipp Hahn <phahn-oss@avm.de>2026-03-03 11:59:14 +0100
committerNamjae Jeon <linkinjeon@kernel.org>2026-03-04 19:23:59 +0900
commit3dce5bb82c97fc2ac28d80d496120a6525ce3fb7 (patch)
treec5073f693bb09069049566c738cd375e2813125d /fs/exfat
parent81440a740d385a992b0652fbd4a5c71edd6f27d2 (diff)
exfat: Fix bitwise operation having different size
cpos has type loff_t (long long), while s_blocksize has type u32. The inversion wil happen on u32, the coercion to s64 happens afterwards and will do 0-left-paddding, resulting in the upper bits getting masked out. Cast s_blocksize to loff_t before negating it. Found by static code analysis using Klocwork. Signed-off-by: Philipp Hahn <phahn-oss@avm.de> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/exfat')
-rw-r--r--fs/exfat/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c
index 3a4853693d8b..e710dd196e2f 100644
--- a/fs/exfat/dir.c
+++ b/fs/exfat/dir.c
@@ -249,7 +249,7 @@ get_new:
*/
if (err == -EIO) {
cpos += 1 << (sb->s_blocksize_bits);
- cpos &= ~(sb->s_blocksize - 1);
+ cpos &= ~(loff_t)(sb->s_blocksize - 1);
}
err = -EIO;