mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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>
This commit is contained in:
parent
81440a740d
commit
3dce5bb82c
|
|
@ -249,7 +249,7 @@ static int exfat_iterate(struct file *file, struct dir_context *ctx)
|
|||
*/
|
||||
if (err == -EIO) {
|
||||
cpos += 1 << (sb->s_blocksize_bits);
|
||||
cpos &= ~(sb->s_blocksize - 1);
|
||||
cpos &= ~(loff_t)(sb->s_blocksize - 1);
|
||||
}
|
||||
|
||||
err = -EIO;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user