mtd: mtdswap: fix integer overflow
PATCH 1/1 mtd: mtdswap: fix integer overflow
Caught by Coverity.
Signed-off-by Brian Norris <[email protected]>
--- drivers/mtd/mtdswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/mtdswap.c +1 -1
@@ -1474,7 +1474,7 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) } eblocks =mtd_div_by_eb (use_size, mtd); - use_size = eblocks * mtd->erasesize; + use_size = (uint64_t )eblocks * mtd->erasesize; bad_blocks =mtdswap_badblocks (mtd, use_size); eavailable = eblocks - bad_blocks;
Signature · 1 line
1.9.1