Browse Source

Merge MTD updates into -next

Brian Norris 10 năm trước cách đây
mục cha
commit
ed446cc720
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      drivers/mtd/nand/pxa3xx_nand.c

+ 2 - 0
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)