diff mbox

mtd: nuc900_nand: NULL dereference in nuc900_nand_enable()

Message ID 20140217200308.GA9845@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Feb. 17, 2014, 8:03 p.m. UTC
Instead of writing to "nand->reg + REG_FMICSR" we write to "REG_FMICSR"
which is NULL and not a valid register.

Fixes: 8bff82cbc308 ('mtd: add nand support for w90p910 (v2)')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff.

Comments

Brian Norris Feb. 23, 2014, 2:37 a.m. UTC | #1
On Mon, Feb 17, 2014 at 11:03:08PM +0300, Dan Carpenter wrote:
> Instead of writing to "nand->reg + REG_FMICSR" we write to "REG_FMICSR"
> which is NULL and not a valid register.
> 
> Fixes: 8bff82cbc308 ('mtd: add nand support for w90p910 (v2)')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.

Pushed to l2-mtd.git. Thanks!

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand/nuc900_nand.c
index 331fccbdde61..e8a5fffd6ab2 100644
--- a/drivers/mtd/nand/nuc900_nand.c
+++ b/drivers/mtd/nand/nuc900_nand.c
@@ -225,7 +225,7 @@  static void nuc900_nand_enable(struct nuc900_nand *nand)
 	val = __raw_readl(nand->reg + REG_FMICSR);
 
 	if (!(val & NAND_EN))
-		__raw_writel(val | NAND_EN, REG_FMICSR);
+		__raw_writel(val | NAND_EN, nand->reg + REG_FMICSR);
 
 	val = __raw_readl(nand->reg + REG_SMCSR);