summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/pxa3xx_nand.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-02-28 12:24:03 +0300
committerBrian Norris <computersforpeace@gmail.com>2015-02-28 12:24:03 +0300
commited446cc7208d80a7e9ddddc757a4d5767b67b4c7 (patch)
tree65adfcd1e2d7b2000e5e5983fc69832df7b293d0 /drivers/mtd/nand/pxa3xx_nand.c
parent24542257a3b987025d4b998ec2d15e556c98ad3f (diff)
parente423c90a6520d704cd885d742b499dfd6b0f6277 (diff)
downloadlinux-ed446cc7208d80a7e9ddddc757a4d5767b67b4c7.tar.xz
Merge MTD updates into -next
Diffstat (limited to 'drivers/mtd/nand/pxa3xx_nand.c')
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 3f09f2e9aeb4..57562c85cc8c 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1622,6 +1622,8 @@ static int alloc_nand_resource(struct platform_device *pdev)
int ret, irq, cs;
pdata = dev_get_platdata(&pdev->dev);
+ if (pdata->num_cs <= 0)
+ return -ENODEV;
info = devm_kzalloc(&pdev->dev, sizeof(*info) + (sizeof(*mtd) +
sizeof(*host)) * pdata->num_cs, GFP_KERNEL);
if (!info)