From: Brian Norris Date: Tue, 22 Jul 2014 02:07:44 +0000 (-0700) Subject: mtd: nandsim: fix integer widening X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b033e1aac9afd314add799b6cd2a5489f892757f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mtd: nandsim: fix integer widening This multiplication should be done in 64-bit, not 32-bit. Caught by Coverity. Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 4f0d83648e5a..7dc1dd28d896 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c @@ -827,7 +827,7 @@ static int parse_badblocks(struct nandsim *ns, struct mtd_info *mtd) NS_ERR("invalid badblocks.\n"); return -EINVAL; } - offset = erase_block_no * ns->geom.secsz; + offset = (loff_t)erase_block_no * ns->geom.secsz; if (mtd_block_markbad(mtd, offset)) { NS_ERR("invalid badblocks.\n"); return -EINVAL;