diff options
author | Pekon Gupta <pekon@ti.com> | 2014-02-17 02:41:25 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-02-23 17:49:57 -0500 |
commit | bb38eefb6858ce16b34716145b9597a5680aa54c (patch) | |
tree | 7694638dbcbd998a78c9b526f57b59ac828c3591 | |
parent | aa6092f9835893290e77c3e24649def49dac1583 (diff) |
mtd: nand: omap: fix ecclayout->oobfree->length
This patch excludes reserved-marker byte-position from oobfree->length
calculation. Thus all bytes from oobfree->offset till end of OOB are free.
CC: <stable@vger.kernel.org> # 3.13.x+
Signed-off-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/nand/omap2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 58685ab6d865..bf642ceef681 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -1994,9 +1994,8 @@ static int omap_nand_probe(struct platform_device *pdev) | |||
1994 | goto return_error; | 1994 | goto return_error; |
1995 | } | 1995 | } |
1996 | 1996 | ||
1997 | /* populate remaining ECC layout data */ | 1997 | /* all OOB bytes from oobfree->offset till end off OOB are free */ |
1998 | ecclayout->oobfree->length = mtd->oobsize - (BADBLOCK_MARKER_LENGTH + | 1998 | ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset; |
1999 | ecclayout->eccbytes); | ||
2000 | /* check if NAND device's OOB is enough to store ECC signatures */ | 1999 | /* check if NAND device's OOB is enough to store ECC signatures */ |
2001 | if (mtd->oobsize < (ecclayout->eccbytes + BADBLOCK_MARKER_LENGTH)) { | 2000 | if (mtd->oobsize < (ecclayout->eccbytes + BADBLOCK_MARKER_LENGTH)) { |
2002 | pr_err("not enough OOB bytes required = %d, available=%d\n", | 2001 | pr_err("not enough OOB bytes required = %d, available=%d\n", |