projects
/
platform
/
kernel
/
linux-arm64.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
caf0e8e
)
mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
author
Roel Kluin
<roel.kluin@gmail.com>
Wed, 16 Dec 2009 00:37:17 +0000
(
01:37
+0100)
committer
David Woodhouse
<David.Woodhouse@intel.com>
Wed, 16 Dec 2009 03:26:33 +0000
(
03:26
+0000)
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>
drivers/mtd/onenand/onenand_base.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/onenand/onenand_base.c
b/drivers/mtd/onenand/onenand_base.c
index
3330ea0
..
f63b1db
100644
(file)
--- a/
drivers/mtd/onenand/onenand_base.c
+++ b/
drivers/mtd/onenand/onenand_base.c
@@
-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;
}