diff options
author | Brian Norris <computersforpeace@gmail.com> | 2014-07-21 22:07:02 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-08-19 14:53:08 -0400 |
commit | 8c3f3f1d7941bcb25590b784f84accd7dcb44ba3 (patch) | |
tree | ec7bfd61402b1689d857b37da4435b519be36125 /drivers/mtd/mtdswap.c | |
parent | 5e47212831ac565993d21ebd36216d98f2b58f30 (diff) |
mtd: mtdswap: fix integer overflow
Caught by Coverity.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/mtdswap.c')
-rw-r--r-- | drivers/mtd/mtdswap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index 0ec96cd5dc78..48cf6f98df44 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c | |||
@@ -1474,7 +1474,7 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) | |||
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | eblocks = mtd_div_by_eb(use_size, mtd); | 1476 | eblocks = mtd_div_by_eb(use_size, mtd); |
1477 | use_size = eblocks * mtd->erasesize; | 1477 | use_size = (uint64_t)eblocks * mtd->erasesize; |
1478 | bad_blocks = mtdswap_badblocks(mtd, use_size); | 1478 | bad_blocks = mtdswap_badblocks(mtd, use_size); |
1479 | eavailable = eblocks - bad_blocks; | 1479 | eavailable = eblocks - bad_blocks; |
1480 | 1480 | ||