You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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
@@ -1228,6 +1228,7 @@ fail2:
|
||||
free_irq(client->irq, menelaus);
|
||||
flush_scheduled_work();
|
||||
fail1:
|
||||
i2c_set_clientdata(client, NULL);
|
||||
kfree(menelaus);
|
||||
return err;
|
||||
}
|
||||
@@ -1237,8 +1238,8 @@ static int __exit menelaus_remove(struct i2c_client *client)
|
||||
struct menelaus_chip *menelaus = i2c_get_clientdata(client);
|
||||
|
||||
free_irq(client->irq, menelaus);
|
||||
kfree(menelaus);
|
||||
i2c_set_clientdata(client, NULL);
|
||||
kfree(menelaus);
|
||||
the_menelaus = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user