aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/nand/nand_base.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 33550c43acc2..9c8da741dce0 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1782,13 +1782,6 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
1782 else 1782 else
1783 len = mtd->oobsize; 1783 len = mtd->oobsize;
1784 1784
1785 /* Do not allow read past end of page */
1786 if ((ops->ooboffs + readlen) > len) {
1787 DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to read "
1788 "past end of page\n", __func__);
1789 return -EINVAL;
1790 }
1791
1792 if (unlikely(ops->ooboffs >= len)) { 1785 if (unlikely(ops->ooboffs >= len)) {
1793 DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start read " 1786 DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start read "
1794 "outside oob\n", __func__); 1787 "outside oob\n", __func__);
@@ -2384,7 +2377,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
2384 return -EINVAL; 2377 return -EINVAL;
2385 } 2378 }
2386 2379
2387 /* Do not allow write past end of device */ 2380 /* Do not allow reads past end of device */
2388 if (unlikely(to >= mtd->size || 2381 if (unlikely(to >= mtd->size ||
2389 ops->ooboffs + ops->ooblen > 2382 ops->ooboffs + ops->ooblen >
2390 ((mtd->size >> chip->page_shift) - 2383 ((mtd->size >> chip->page_shift) -