summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2010-03-20 15:13:03 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-30 09:30:08 -0700
commitb36fc07dc3c742bd704c59d85c8cf12585a00e41 (patch)
treebc1b6fa197ada65e90d26b6f2a336a5278a0b3d8
parentef6d4f54cca5962127b47ee8a355611aafedd526 (diff)
downloadop-kernel-dev-b36fc07dc3c742bd704c59d85c8cf12585a00e41.zip
op-kernel-dev-b36fc07dc3c742bd704c59d85c8cf12585a00e41.tar.gz
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>
-rw-r--r--drivers/staging/iio/light/tsl2563.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c
index 1ba4aa3..8770a00 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,
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;
}
OpenPOWER on IntegriCloud