projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c115add
)
mtd: nandsim: fix integer widening
author
Brian Norris
<computersforpeace@gmail.com>
Tue, 22 Jul 2014 02:07:44 +0000
(19:07 -0700)
committer
Brian Norris
<computersforpeace@gmail.com>
Tue, 19 Aug 2014 18:53:08 +0000
(11:53 -0700)
This multiplication should be done in 64-bit, not 32-bit.
Caught by Coverity.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nandsim.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/nandsim.c
b/drivers/mtd/nand/nandsim.c
index 4f0d83648e5a5ad9f5f0260e21b01067f81099be..7dc1dd28d896ca5e532ded77a6b4e8a25b044e5c 100644
(file)
--- 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;