tree 6ac35c667e98a5e2ea5fa219668a16dd2eb8830d
parent e5a3e8ca948e8ac0dad751dbd75e4dc96b4277e9
author Dan Brown <[EMAIL PROTECTED]> Wed, 06 Apr 2005 21:13:09 +0100
committer Thomas Gleixner <[EMAIL PROTECTED]> Mon, 23 May 2005 13:10:30 +0200

[MTD] NAND: Fix reading of autoplaced OOB when there are multiple free sections.
Signed-off-by: Dan Brown <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/nand/nand_base.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -59,7 +59,7 @@
  *     The AG-AND chips have nice features for speed improvement,
  *     which are not supported yet. Read / program 4 pages in one go.
  *
- * $Id: nand_base.c,v 1.140 2005/04/04 18:56:29 gleixner Exp $
+ * $Id: nand_base.c,v 1.141 2005/04/06 20:13:05 dbrown Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -1285,13 +1285,12 @@ int nand_do_read_ecc (struct mtd_info *m
                        switch(oobsel->useecc) {
                        case MTD_NANDECC_AUTOPLACE:
                                /* Walk through the autoplace chunks */
-                               for (i = 0, j = 0; j < mtd->oobavail; i++) {
+                               for (i = 0; oobsel->oobfree[i][1]; i++) {
                                        int from = oobsel->oobfree[i][0];
                                        int num = oobsel->oobfree[i][1];
                                        memcpy(&oob_buf[oob], &oob_data[from], 
num);
-                                       j+= num;
+                                       oob += num;
                                }
-                               oob += mtd->oobavail;
                                break;
                        case MTD_NANDECC_PLACE:
                                /* YAFFS1 legacy mode */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to