summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-02-18 00:03:08 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-13 16:11:31 +0400
commitc3a47361053bdd9059eec78510de21684f4112c5 (patch)
tree8506be3a2c4021a75507e0460b8cef4d85fb8a9c /drivers/mtd
parentfd9a5e6cd4d5f923eff026dd288764cf65c001a7 (diff)
downloadlinux-c3a47361053bdd9059eec78510de21684f4112c5.tar.xz
mtd: nuc900_nand: NULL dereference in nuc900_nand_enable()
commit c69dbbf3335a21aae74376d7e5db50a486d52439 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nuc900_nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand/nuc900_nand.c
index 8febe46e1105..9f55d40ec69e 100644
--- a/drivers/mtd/nand/nuc900_nand.c
+++ b/drivers/mtd/nand/nuc900_nand.c
@@ -250,7 +250,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);