diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-03-20 15:12:58 +0100 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-03-22 20:46:16 +0100 |
commit | 8b4709ecea4aab1957ae7b726d6824485404a3a5 (patch) | |
tree | a06347a92952b086cb48e8186682daf4f9884548 /drivers/regulator/max1586.c | |
parent | lp3971: Fix BUCK_VOL_CHANGE_SHIFT logic (diff) | |
download | linux-8b4709ecea4aab1957ae7b726d6824485404a3a5.tar.xz linux-8b4709ecea4aab1957ae7b726d6824485404a3a5.zip |
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/max1586.c')
-rw-r--r-- | drivers/regulator/max1586.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index a49fc952c9a9..c0b09e15edb6 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -243,8 +243,8 @@ static int __devexit max1586_pmic_remove(struct i2c_client *client) for (i = 0; i <= MAX1586_V6; i++) if (rdev[i]) regulator_unregister(rdev[i]); - kfree(rdev); i2c_set_clientdata(client, NULL); + kfree(rdev); return 0; } |