mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
caf0e8e028
commit
0a032a4df6
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue