提交 01cd2aba 编写于 作者: M Marek Vasut 提交者: David Woodhouse

gen_nand: Test if nr_chips field is valid

Signed-off-by: NMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 ef56609f
......@@ -37,6 +37,11 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
struct resource *res;
int err = 0;
if (pdata->chip.nr_chips < 1) {
dev_err(&pdev->dev, "invalid number of chips specified\n");
return -EINVAL;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENXIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册