diff options
author | Yuezhang Mo <Yuezhang.Mo@sony.com> | 2022-12-13 09:40:32 +0800 |
---|---|---|
committer | Namjae Jeon <linkinjeon@kernel.org> | 2022-12-13 20:17:11 +0900 |
commit | 40306b4d1ba25970dafd53432e8daa5d591ebd99 (patch) | |
tree | b150d91967727c957e09b02c9fbbf783ca7d459a | |
parent | f7cde96710a4362dca199458d3de04f631178453 (diff) | |
download | linux-40306b4d1ba25970dafd53432e8daa5d591ebd99.tar.gz |
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>
-rw-r--r-- | fs/exfat/exfat_fs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index a1e7feb22079..bc6d21d7c5ad 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -400,7 +400,7 @@ static inline sector_t exfat_cluster_to_sector(struct exfat_sb_info *sbi, sbi->data_start_sector; } -static inline int exfat_sector_to_cluster(struct exfat_sb_info *sbi, +static inline unsigned int exfat_sector_to_cluster(struct exfat_sb_info *sbi, sector_t sec) { return ((sec - sbi->data_start_sector) >> sbi->sect_per_clus_bits) + |