From: Roel Kluin Date: Wed, 16 Dec 2009 00:37:17 +0000 (+0100) Subject: mtd: OneNAND: Fix test of unsigned in onenand_otp_walk() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a032a4df6dc4a82bcd1c401e57ee71825d30c14;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 3330ea06917c..f63b1db3ffb3 100644 --- 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; }