samples: fs: Fix possible integer overflow
We are doing math of two 32-bit numbers and assigning into a 64-bit result. Add explicit cast of one of the values being multipled to get explicit promotion. Fixes: #13883 Coverity CID: 190930 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
11b3dce674
commit
9fa8674239
|
@ -58,7 +58,7 @@ void main(void)
|
|||
}
|
||||
printk("Sector size %u\n", block_size);
|
||||
|
||||
memory_size_mb = block_count * block_size;
|
||||
memory_size_mb = (u64_t)block_count * block_size;
|
||||
printk("Memory Size(MB) %u\n", (u32_t)memory_size_mb>>20);
|
||||
} while (0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue