提交 0a032a4d 编写于 作者: R Roel Kluin 提交者: David Woodhouse

mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()

mtd->writesize and len are unsigned so the test does not work.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 caf0e8e0
......@@ -3165,10 +3165,10 @@ static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
/* Check User/Factory boundary */
if (mode == MTD_OTP_USER) {
if (((mtd->writesize * otp_pages) - (from + len)) < 0)
if (mtd->writesize * otp_pages < from + len)
return 0;
} else {
if (((mtd->writesize * otp_pages) - len) < 0)
if (mtd->writesize * otp_pages < len)
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册