[1/6] Return a valid count in count_used_clusters()
diff mbox series

Message ID 20191009133157.14028-2-philipp.ammann@posteo.de
State New
Headers show
Series
  • Various exfat fixes
Related show

Commit Message

Philipp Ammann Oct. 9, 2019, 1:31 p.m. UTC
From: Andreas Schneider <asn@cryptomilk.org>

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
---
 drivers/staging/exfat/exfat_core.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

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;
 }