Skip to content

Commit

Permalink
mfd: Add missing out of memory check for pcf50633
Browse files Browse the repository at this point in the history
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44561
Reported-by: <rucsoftsec@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Alan-Cox authored and Samuel Ortiz committed Jul 16, 2012
1 parent ad95ad1 commit 18273c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/mfd/pcf50633-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
}

pdev->dev.parent = pcf->dev;
platform_device_add_data(pdev, &pdata->reg_init_data[i],
sizeof(pdata->reg_init_data[i]));
if (platform_device_add_data(pdev, &pdata->reg_init_data[i],
sizeof(pdata->reg_init_data[i])) < 0) {
platform_device_put(pdev);
dev_err(pcf->dev, "Out of memory for regulator parameters %d\n",
i);
continue;
}
pcf->regulator_pdev[i] = pdev;

platform_device_add(pdev);
Expand Down

0 comments on commit 18273c5

Please sign in to comment.