mtd: nuc900_nand: NULL dereference in nuc900_nand_enable()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 17 Feb 2014 20:03:08 +0000 (23:03 +0300)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 11 Mar 2014 05:42:27 +0000 (22:42 -0700)
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>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nuc900_nand.c

index 331fccbdde61b35406f4ccad9b82214758196225..e8a5fffd6ab248bdf5329eb9fb7bf1674a3b92e9 100644 (file)
@@ -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);