diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-03-20 10:13:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-30 12:30:08 -0400 |
commit | b36fc07dc3c742bd704c59d85c8cf12585a00e41 (patch) | |
tree | bc1b6fa197ada65e90d26b6f2a336a5278a0b3d8 /drivers/staging | |
parent | ef6d4f54cca5962127b47ee8a355611aafedd526 (diff) |
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/iio/light/tsl2563.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 1ba4aa392f6e..8770a00e3652 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c | |||
@@ -682,6 +682,7 @@ static int __devinit tsl2563_probe(struct i2c_client *client, | |||
682 | fail2: | 682 | fail2: |
683 | iio_device_unregister(chip->indio_dev); | 683 | iio_device_unregister(chip->indio_dev); |
684 | fail1: | 684 | fail1: |
685 | i2c_set_clientdata(client, NULL); | ||
685 | kfree(chip); | 686 | kfree(chip); |
686 | return err; | 687 | return err; |
687 | } | 688 | } |
@@ -692,6 +693,7 @@ static int tsl2563_remove(struct i2c_client *client) | |||
692 | 693 | ||
693 | iio_device_unregister(chip->indio_dev); | 694 | iio_device_unregister(chip->indio_dev); |
694 | 695 | ||
696 | i2c_set_clientdata(client, NULL); | ||
695 | kfree(chip); | 697 | kfree(chip); |
696 | return 0; | 698 | return 0; |
697 | } | 699 | } |