mfd: 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> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
d84027bc4d
commit
f322d5f009
@@ -920,6 +920,7 @@ static int __init ab3100_probe(struct i2c_client *client,
|
||||
i2c_unregister_device(ab3100->testreg_client);
|
||||
exit_no_testreg_client:
|
||||
exit_no_detect:
|
||||
i2c_set_clientdata(client, NULL);
|
||||
kfree(ab3100);
|
||||
return err;
|
||||
}
|
||||
@@ -941,6 +942,7 @@ static int __exit ab3100_remove(struct i2c_client *client)
|
||||
* their notifiers so deactivate IRQ
|
||||
*/
|
||||
free_irq(client->irq, ab3100);
|
||||
i2c_set_clientdata(client, NULL);
|
||||
kfree(ab3100);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user