Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c3f3f1d authored by Brian Norris's avatar Brian Norris
Browse files

mtd: mtdswap: fix integer overflow



Caught by Coverity.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 5e472128
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;