Skip to content

Commit

Permalink
mc13783-regulator: fix a memory leak in mc13783_regulator_remove
Browse files Browse the repository at this point in the history
This patch fixes a memory leak by freeing priv in mc13783_regulator_remove

Signed-off-by: Axel 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: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Axel Lin authored and Liam Girdwood committed Apr 19, 2010
1 parent be1a50d commit 58d5765
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 @@ -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;
}

Expand Down

0 comments on commit 58d5765

Please sign in to comment.