Commit 80099c70 authored by Dan Carpenter's avatar Dan Carpenter Committed by Liam Girdwood

dereferencing freed memory regulator_fixed_voltage_remove()

Don't dereference drvdata after it has been freed.

regards,
dan carpenter
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 9a767d43
...@@ -196,11 +196,10 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev) ...@@ -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;
} }
......
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