diff options
author | Jarkko Lavinen <jarkko.lavinen@nokia.com> | 2005-04-11 15:16:11 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 13:17:30 +0200 |
commit | 0a18cde60f384d1f7aa012aba004766fb633a31d (patch) | |
tree | a3b0387c2c8285962a15ba02c721356623a94876 | |
parent | 65c6e0a657012d104fe42be5f01a7b9b451b687c (diff) | |
download | linux-3.10-0a18cde60f384d1f7aa012aba004766fb633a31d.tar.gz linux-3.10-0a18cde60f384d1f7aa012aba004766fb633a31d.tar.bz2 linux-3.10-0a18cde60f384d1f7aa012aba004766fb633a31d.zip |
[MTD] NAND: Fix the broken dynamic array allocations
Reverting the change from 1.136 to 1.137 (back to static allocation of ecc
arrays) due to stack corruption and ecc errors.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index b73f3c4e892..c1a971ca57e 100644 --- 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.141 2005/04/06 20:13:05 dbrown Exp $ + * $Id: nand_base.c,v 1.142 2005/04/11 14:16:07 lavinen 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 @@ -855,7 +855,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa u_char *oob_buf, struct nand_oobinfo *oobsel, int cached) { int i, status; - u_char ecc_code[oobsel->eccbytes]; + u_char ecc_code[32]; int eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE; int *oob_config = oobsel->eccpos; int datidx = 0, eccidx = 0, eccsteps = this->eccsteps; @@ -961,7 +961,7 @@ static int nand_verify_pages (struct mtd_info *mtd, struct nand_chip *this, int int i, j, datidx = 0, oobofs = 0, res = -EIO; int eccsteps = this->eccsteps; int hweccbytes; - u_char oobdata[mtd->oobsize]; + u_char oobdata[64]; hweccbytes = (this->options & NAND_HWECC_SYNDROME) ? (oobsel->eccbytes / eccsteps) : 0; @@ -1111,8 +1111,8 @@ int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0; struct nand_chip *this = mtd->priv; u_char *data_poi, *oob_data = oob_buf; - u_char ecc_calc[oobsel->eccbytes]; - u_char ecc_code[oobsel->eccbytes]; + u_char ecc_calc[32]; + u_char ecc_code[32]; int eccmode, eccsteps; int *oob_config, datidx; int blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) - 1; |