diff --git a/[refs] b/[refs] index cbcaf62f7cc8..276d52bac321 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 32c78de8f17369def492ea3ddd785f0cc140af02 +refs/heads/master: cbe10a3674ba1cfa227d0d4e990353bada85fa09 diff --git a/trunk/drivers/regulator/mc13783-regulator.c b/trunk/drivers/regulator/mc13783-regulator.c index 56d4a677c404..8e9b90ad88ae 100644 --- a/trunk/drivers/regulator/mc13783-regulator.c +++ b/trunk/drivers/regulator/mc13783-regulator.c @@ -344,7 +344,7 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id); - priv = kzalloc(sizeof(*priv) + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv) + pdata->num_regulators * sizeof(priv->regulators[0]), GFP_KERNEL); if (!priv) @@ -374,8 +374,6 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev) while (--i >= 0) regulator_unregister(priv->regulators[i]); - kfree(priv); - return ret; } @@ -391,7 +389,6 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev) for (i = 0; i < pdata->num_regulators; i++) regulator_unregister(priv->regulators[i]); - kfree(priv); return 0; }