2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-20 08:38:24 +08:00

Staging: iio: light: 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: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Wolfram Sang 2010-03-20 15:13:03 +01:00 committed by Greg Kroah-Hartman
parent ef6d4f54cc
commit b36fc07dc3

View File

@ -682,6 +682,7 @@ static int __devinit tsl2563_probe(struct i2c_client *client,
fail2:
iio_device_unregister(chip->indio_dev);
fail1:
i2c_set_clientdata(client, NULL);
kfree(chip);
return err;
}
@ -692,6 +693,7 @@ static int tsl2563_remove(struct i2c_client *client)
iio_device_unregister(chip->indio_dev);
i2c_set_clientdata(client, NULL);
kfree(chip);
return 0;
}