提交 b033e1aa 编写于 作者: B Brian Norris

mtd: nandsim: fix integer widening

This multiplication should be done in 64-bit, not 32-bit.

Caught by Coverity.
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 c115add9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册