Skip to content

Commit

Permalink
regulator: mc13783: bail out without platform data
Browse files Browse the repository at this point in the history
the platform data pointer is used without checking it. Bail out
in the driver instead of crashing the kernel.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
saschahauer authored and broonie committed Mar 11, 2012
1 parent 3bf6e90 commit 0757b60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/regulator/mc13783-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0757b60

Please sign in to comment.