Skip to content

Commit

Permalink
gen_nand: Test if nr_chips field is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Marek Vasut authored and David Woodhouse committed Aug 12, 2010
1 parent ef56609 commit 01cd2ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/mtd/nand/plat_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 01cd2ab

Please sign in to comment.