mtd: nand: omap: fix ecclayout->oobfree->length

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun Feb 23 17:59:01 EST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=bb38eefb6858ce16b34716145b9597a5680aa54c
Commit:     bb38eefb6858ce16b34716145b9597a5680aa54c
Parent:     aa6092f9835893290e77c3e24649def49dac1583
Author:     Pekon Gupta <pekon at ti.com>
AuthorDate: Mon Feb 17 13:11:25 2014 +0530
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Sun Feb 23 14:49:57 2014 -0800

    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 at vger.kernel.org> # 3.13.x+
    Signed-off-by: Pekon Gupta <pekon at ti.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/omap2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 58685ab..bf642ce 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)
 		goto return_error;
 	}
 
-	/* populate remaining ECC layout data */
-	ecclayout->oobfree->length = mtd->oobsize - (BADBLOCK_MARKER_LENGTH +
-							ecclayout->eccbytes);
+	/* all OOB bytes from oobfree->offset till end off OOB are free */
+	ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset;
 	/* check if NAND device's OOB is enough to store ECC signatures */
 	if (mtd->oobsize < (ecclayout->eccbytes + BADBLOCK_MARKER_LENGTH)) {
 		pr_err("not enough OOB bytes required = %d, available=%d\n",



More information about the linux-mtd-cvs mailing list