gen_nand: Test if nr_chips field is valid
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
ef56609f9c
commit
01cd2ababd
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue