aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2014-07-21 19:07:44 -0700
committerBrian Norris <computersforpeace@gmail.com>2014-08-19 11:53:08 -0700
commitb033e1aac9afd314add799b6cd2a5489f892757f (patch)
treeb1a85ef80b4a8eb990f1aeed5736e6712366e2d6 /drivers/mtd/nand/nandsim.c
parentmtd: nand: denali: set proper error code on timeout (diff)
downloadlinux-dev-b033e1aac9afd314add799b6cd2a5489f892757f.tar.xz
linux-dev-b033e1aac9afd314add799b6cd2a5489f892757f.zip
mtd: nandsim: fix integer widening
This multiplication should be done in 64-bit, not 32-bit. Caught by Coverity. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c2
1 files changed, 1 insertions, 1 deletions
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;