Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb38eefb authored by Pekon Gupta's avatar Pekon Gupta Committed by Brian Norris
Browse files

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: default avatarPekon Gupta <pekon@ti.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent aa6092f9
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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",