Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01cd2aba authored by Marek Vasut's avatar Marek Vasut Committed by David Woodhouse
Browse files

gen_nand: Test if nr_chips field is valid

parent ef56609f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;