aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8660.c
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2010-03-20 10:12:58 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-03-22 15:46:16 -0400
commit8b4709ecea4aab1957ae7b726d6824485404a3a5 (patch)
treea06347a92952b086cb48e8186682daf4f9884548 /drivers/regulator/max8660.c
parent451a73cd46573444f68f412c87439c0a291718ec (diff)
regulator: fix dangling pointers
Fix I2C-drivers which missed setting clientdata to NULL before freeing the structure it points to. Also fix drivers which do this _after_ the structure was freed already. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/max8660.c')
-rw-r--r--drivers/regulator/max8660.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index f12f1bb62138..47f90b2fc290 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -470,8 +470,8 @@ static int __devexit max8660_remove(struct i2c_client *client)
470 for (i = 0; i < MAX8660_V_END; i++) 470 for (i = 0; i < MAX8660_V_END; i++)
471 if (rdev[i]) 471 if (rdev[i])
472 regulator_unregister(rdev[i]); 472 regulator_unregister(rdev[i]);
473 kfree(rdev);
474 i2c_set_clientdata(client, NULL); 473 i2c_set_clientdata(client, NULL);
474 kfree(rdev);
475 475
476 return 0; 476 return 0;
477} 477}