aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJarkko Lavinen <jarkko.lavinen@nokia.com>2005-04-11 10:16:11 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 07:17:30 -0400
commit0a18cde60f384d1f7aa012aba004766fb633a31d (patch)
treea3b0387c2c8285962a15ba02c721356623a94876 /drivers/mtd
parent65c6e0a657012d104fe42be5f01a7b9b451b687c (diff)
[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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_base.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index b73f3c4e892b..c1a971ca57e6 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -59,7 +59,7 @@
59 * The AG-AND chips have nice features for speed improvement, 59 * The AG-AND chips have nice features for speed improvement,
60 * which are not supported yet. Read / program 4 pages in one go. 60 * which are not supported yet. Read / program 4 pages in one go.
61 * 61 *
62 * $Id: nand_base.c,v 1.141 2005/04/06 20:13:05 dbrown Exp $ 62 * $Id: nand_base.c,v 1.142 2005/04/11 14:16:07 lavinen Exp $
63 * 63 *
64 * This program is free software; you can redistribute it and/or modify 64 * This program is free software; you can redistribute it and/or modify
65 * it under the terms of the GNU General Public License version 2 as 65 * 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
855 u_char *oob_buf, struct nand_oobinfo *oobsel, int cached) 855 u_char *oob_buf, struct nand_oobinfo *oobsel, int cached)
856{ 856{
857 int i, status; 857 int i, status;
858 u_char ecc_code[oobsel->eccbytes]; 858 u_char ecc_code[32];
859 int eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE; 859 int eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE;
860 int *oob_config = oobsel->eccpos; 860 int *oob_config = oobsel->eccpos;
861 int datidx = 0, eccidx = 0, eccsteps = this->eccsteps; 861 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
961 int i, j, datidx = 0, oobofs = 0, res = -EIO; 961 int i, j, datidx = 0, oobofs = 0, res = -EIO;
962 int eccsteps = this->eccsteps; 962 int eccsteps = this->eccsteps;
963 int hweccbytes; 963 int hweccbytes;
964 u_char oobdata[mtd->oobsize]; 964 u_char oobdata[64];
965 965
966 hweccbytes = (this->options & NAND_HWECC_SYNDROME) ? (oobsel->eccbytes / eccsteps) : 0; 966 hweccbytes = (this->options & NAND_HWECC_SYNDROME) ? (oobsel->eccbytes / eccsteps) : 0;
967 967
@@ -1111,8 +1111,8 @@ int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
1111 int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0; 1111 int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0;
1112 struct nand_chip *this = mtd->priv; 1112 struct nand_chip *this = mtd->priv;
1113 u_char *data_poi, *oob_data = oob_buf; 1113 u_char *data_poi, *oob_data = oob_buf;
1114 u_char ecc_calc[oobsel->eccbytes]; 1114 u_char ecc_calc[32];
1115 u_char ecc_code[oobsel->eccbytes]; 1115 u_char ecc_code[32];
1116 int eccmode, eccsteps; 1116 int eccmode, eccsteps;
1117 int *oob_config, datidx; 1117 int *oob_config, datidx;
1118 int blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) - 1; 1118 int blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) - 1;