VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Phillip Lougher <phillip@squashfs.org.uk> 2021-05-14 17:27:16 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-05-14 19:41:32 -0700 commit: d6e621de1fceb3b098ebf435ef7ea91ec4838a1a parent: eb1f065f90cdcdcc704e9e2dc678931317c69a99
Commit Summary:
squashfs: fix divide error in calculate_skip()
Diffstat:
1 file changed, 3 insertions, 3 deletions
diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c
index 7b1128398976..89d492916dea 100644
--- a/fs/squashfs/file.c
+++ b/fs/squashfs/file.c
@@ -211,11 +211,11 @@ failure:
  * If the skip factor is limited in this way then the file will use multiple
  * slots.
  */
-static inline int calculate_skip(int blocks)
+static inline int calculate_skip(u64 blocks)
 {
-	int skip = blocks / ((SQUASHFS_META_ENTRIES + 1)
+	u64 skip = blocks / ((SQUASHFS_META_ENTRIES + 1)
 		 * SQUASHFS_META_INDEXES);
-	return min(SQUASHFS_CACHED_BLKS - 1, skip + 1);
+	return min((u64) SQUASHFS_CACHED_BLKS - 1, skip + 1);
 }