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: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
        }
 
        /* Calculate remaining oob bytes */
-       i = oob - chip->oob_poi;
+       i = mtd->oobsize - (oob - chip->oob_poi);
        if (i)
                chip->read_buf(mtd, oob, i);
 
        }
 
        /* Calculate remaining oob bytes */
-       i = oob - chip->oob_poi;
+       i = mtd->oobsize - (oob - chip->oob_poi);
        if (i)
                chip->write_buf(mtd, oob, i);
 }