Commit 58d57658 authored by Axel Lin's avatar Axel Lin Committed by Liam Girdwood

mc13783-regulator: fix a memory leak in mc13783_regulator_remove

This patch fixes a memory leak by freeing priv in mc13783_regulator_remove
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent be1a50d4
......@@ -618,9 +618,12 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev)
dev_get_platdata(&pdev->dev);
int i;
platform_set_drvdata(pdev, NULL);
for (i = 0; i < pdata->num_regulators; i++)
regulator_unregister(priv->regulators[i]);
kfree(priv);
return 0;
}
......
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