Patchwork [05/18] fsmc_nand.c: Fixed data abort inside change_bit()

login
register
mail settings
Submitter Vipin Kumar
Date March 7, 2012, 11:30 a.m.
Message ID <a289aad6aca8156a196b88c5f3674a809a0dbf4d.1331119143.git.vipin.kumar@st.com>
Download mbox | patch
Permalink /patch/145191/
State New
Headers show

Comments

Vipin Kumar - March 7, 2012, 11:30 a.m.
From: Armando Visconti <armando.visconti@st.com>

Since change_bit() requires a (unsigned int *) as second arg,
the correct definition of err_idx[] array declared as
local variable of fsmc_correct_data() is the following:

	u32 err_idx[8];

Signed-off-by: Armando Visconti <armando.visconti@st.com>
---
 drivers/mtd/nand/fsmc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 4dda9bb..cfe15a6 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -604,7 +604,7 @@  static int fsmc_correct_data(struct mtd_info *mtd, uint8_t *dat,
 	struct nand_chip *chip = mtd->priv;
 	struct fsmc_regs *regs = host->regs_va;
 	unsigned int bank = host->bank;
-	uint16_t err_idx[8];
+	uint32_t err_idx[8];
 	uint64_t ecc_data[2];
 	uint32_t num_err, i;