mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
mtd: mtdswap: fix integer overflow
Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
5e47212831
commit
8c3f3f1d79
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue