mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
dereferencing freed memory regulator_fixed_voltage_remove()
Don't dereference drvdata after it has been freed. regards, dan carpenter Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
parent
9a767d43fb
commit
80099c707e
1 changed files with 2 additions and 3 deletions
|
@ -196,11 +196,10 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev)
|
||||||
struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev);
|
struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
regulator_unregister(drvdata->dev);
|
regulator_unregister(drvdata->dev);
|
||||||
kfree(drvdata->desc.name);
|
|
||||||
kfree(drvdata);
|
|
||||||
|
|
||||||
if (gpio_is_valid(drvdata->gpio))
|
if (gpio_is_valid(drvdata->gpio))
|
||||||
gpio_free(drvdata->gpio);
|
gpio_free(drvdata->gpio);
|
||||||
|
kfree(drvdata->desc.name);
|
||||||
|
kfree(drvdata);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue