Commit 18273c5b authored by Alan Cox's avatar Alan Cox Committed by Samuel Ortiz

mfd: Add missing out of memory check for pcf50633

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: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent ad95ad10
...@@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client, ...@@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
} }
pdev->dev.parent = pcf->dev; pdev->dev.parent = pcf->dev;
platform_device_add_data(pdev, &pdata->reg_init_data[i], if (platform_device_add_data(pdev, &pdata->reg_init_data[i],
sizeof(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; pcf->regulator_pdev[i] = pdev;
platform_device_add(pdev); platform_device_add(pdev);
......
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