提交 0757b602 编写于 作者: S Sascha Hauer 提交者: 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: NSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 3bf6e90e
......@@ -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);
if (!pdata)
return -EINVAL;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv) +
pdata->num_regulators * sizeof(priv->regulators[0]),
GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册