diff options
author | Dan Carpenter <error27@gmail.com> | 2009-11-16 04:05:03 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-11-16 07:40:25 -0500 |
commit | 80099c707e0915ac3159ddc70fb714adbb3d53e3 (patch) | |
tree | 621aefafce62e64ab79a999b9cd4bebe9ef47e6d /drivers/regulator/fixed.c | |
parent | 9a767d43fbddb3319dca568df49c48e0d1bb6bd8 (diff) |
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>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r-- | drivers/regulator/fixed.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index f8b295700d7d..f9f516a3028a 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c | |||
@@ -196,11 +196,10 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev) | |||
196 | struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev); | 196 | struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev); |
197 | 197 | ||
198 | regulator_unregister(drvdata->dev); | 198 | regulator_unregister(drvdata->dev); |
199 | kfree(drvdata->desc.name); | ||
200 | kfree(drvdata); | ||
201 | |||
202 | if (gpio_is_valid(drvdata->gpio)) | 199 | if (gpio_is_valid(drvdata->gpio)) |
203 | gpio_free(drvdata->gpio); | 200 | gpio_free(drvdata->gpio); |
201 | kfree(drvdata->desc.name); | ||
202 | kfree(drvdata); | ||
204 | 203 | ||
205 | return 0; | 204 | return 0; |
206 | } | 205 | } |