Since this expression might overflow, put it in a variable.
Signed-off-by: Simon Glass <[email protected]>
---
(no changes since v1)
fs/ext4/ext4_write.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
index 8e6179c4a99..86420d1c9d7 100644
--- a/fs/ext4/ext4_write.c
+++ b/fs/ext4/ext4_write.c
@@ -108,9 +108,11 @@ int ext4fs_get_bgdtable(void)
{
int status;
struct ext_filesystem *fs = get_fs();
+ size_t alloc_size;
int gdsize_total;
- gdsize_total = ROUND(fs->no_blkgrp * fs->gdsize, fs->blksz);
+ alloc_size = fs->no_blkgrp * fs->gdsize;
+ gdsize_total = ROUND(alloc_size, fs->blksz);
fs->no_blk_pergdt = gdsize_total / fs->blksz;
/* allocate memory for gdtable */
--
2.43.0