From: Andreas Schneider <asn@xxxxxxxxxxxxxx> Signed-off-by: Andreas Schneider <asn@xxxxxxxxxxxxxx> --- drivers/staging/exfat/exfat_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index b3e9cf725cf5..eef9e2726b6b 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -482,6 +482,9 @@ s32 exfat_count_used_clusters(struct super_block *sb) } } + if ((p_fs->num_clusters - 2) < (s32)count) + count = p_fs->num_clusters - 2; + return count; } -- 2.21.0