Commit 7e4178f9 authored by Vitaly Wool's avatar Vitaly Wool Committed by David Woodhouse

[PATCH] NAND: fix remaining OOB length calculation

In nand_read_page_syndrome/nand_write_page_syndrome the calculation of
the remaining oob length which is not used by the prepad/ecc/postpad
areas is wrong.
Signed-off-by: default avatarVitaly Wool <vwool@ru.mvista.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent b6d5ee00
...@@ -883,7 +883,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -883,7 +883,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
} }
/* Calculate remaining oob bytes */ /* Calculate remaining oob bytes */
i = oob - chip->oob_poi; i = mtd->oobsize - (oob - chip->oob_poi);
if (i) if (i)
chip->read_buf(mtd, oob, i); chip->read_buf(mtd, oob, i);
...@@ -1334,7 +1334,7 @@ static void nand_write_page_syndrome(struct mtd_info *mtd, ...@@ -1334,7 +1334,7 @@ static void nand_write_page_syndrome(struct mtd_info *mtd,
} }
/* Calculate remaining oob bytes */ /* Calculate remaining oob bytes */
i = oob - chip->oob_poi; i = mtd->oobsize - (oob - chip->oob_poi);
if (i) if (i)
chip->write_buf(mtd, oob, i); chip->write_buf(mtd, oob, i);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment