X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fmtd%2Fnand%2Fnand_util.c;h=29c42f73b1cc4c3c2131a332e68763937ed49585;hb=93502a5e0adcfc0ce6cf8e3daa7eb9a4f4e53658;hp=df7f1400f3aa3f49c663f89497c5fadb56581cfe;hpb=4b142febff71eabdb7ddbb125c7b583b24ddc434;p=u-boot diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c index df7f1400f3..29c42f73b1 100644 --- a/drivers/mtd/nand/nand_util.c +++ b/drivers/mtd/nand/nand_util.c @@ -486,7 +486,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length, len_incl_bad = get_len_incl_bad (nand, offset, *length); - if ((offset + len_incl_bad) >= nand->size) { + if ((offset + len_incl_bad) > nand->size) { printf ("Attempt to write outside the flash area\n"); return -EINVAL; } @@ -558,7 +558,7 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length, len_incl_bad = get_len_incl_bad (nand, offset, *length); - if ((offset + len_incl_bad) >= nand->size) { + if ((offset + len_incl_bad) > nand->size) { printf ("Attempt to read outside the flash area\n"); return -EINVAL; }