From 8b4709ecea4aab1957ae7b726d6824485404a3a5 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Sat, 20 Mar 2010 15:12:58 +0100 Subject: 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 Cc: Liam Girdwood Cc: Mark Brown Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- drivers/regulator/max8660.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/regulator/max8660.c') diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index f12f1bb6213..47f90b2fc29 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c @@ -470,8 +470,8 @@ static int __devexit max8660_remove(struct i2c_client *client) for (i = 0; i < MAX8660_V_END; i++) if (rdev[i]) regulator_unregister(rdev[i]); - kfree(rdev); i2c_set_clientdata(client, NULL); + kfree(rdev); return 0; } -- cgit v1.2.3