Skip to content

Commit 40306b4

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: fix overflow in sector and cluster conversion
According to the exFAT specification, there are at most 2^32-11 clusters in a volume. so using 'int' is not enough for cluster index, the return value type of exfat_sector_to_cluster() should be 'unsigned int'. Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent f7cde96 commit 40306b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/exfat/exfat_fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi,
400400
sbi->data_start_sector;
401401
}
402402

403-
static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi,
403+
static inline unsigned int exfat_sector_to_cluster(struct exfat_sb_info *sbi,
404404
sector_t sec)
405405
{
406406
return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) +

0 commit comments

Comments
 (0)