Commit 0757b602 authored by Sascha Hauer's avatar Sascha Hauer Committed by Mark Brown

regulator: mc13783: bail out without platform data

the platform data pointer is used without checking it. Bail out
in the driver instead of crashing the kernel.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 3bf6e90e
...@@ -344,6 +344,9 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev) ...@@ -344,6 +344,9 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id); dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id);
if (!pdata)
return -EINVAL;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv) + priv = devm_kzalloc(&pdev->dev, sizeof(*priv) +
pdata->num_regulators * sizeof(priv->regulators[0]), pdata->num_regulators * sizeof(priv->regulators[0]),
GFP_KERNEL); GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment