summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov2011-03-17 06:09:09 +0100
committerDmitry Torokhov2011-03-17 07:28:23 +0100
commit2721a89ac41f2e7705484c1582c293c4eee5344d (patch)
treebf9631ffaa8364e360bdb38d8ea32fc234e5972b /drivers/input
parentInput: tsc2005 - add module description (diff)
downloadkernel-qcow2-linux-2721a89ac41f2e7705484c1582c293c4eee5344d.tar.gz
kernel-qcow2-linux-2721a89ac41f2e7705484c1582c293c4eee5344d.tar.xz
kernel-qcow2-linux-2721a89ac41f2e7705484c1582c293c4eee5344d.zip
Input: tsc2005 - clear driver data after unbinding
We should not leave garbage pointers in driver structure after we unbind it from the device or if bind fails. Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/tsc2005.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 596fd1f01b22..732c81e9a3e6 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -634,8 +634,10 @@ static int __devinit tsc2005_probe(struct spi_device *spi)
spi_setup(spi);
r = tsc2005_setup(ts, pdata);
- if (r)
+ if (r) {
kfree(ts);
+ spi_set_drvdata(spi, NULL);
+ }
return r;
}
@@ -659,6 +661,7 @@ static int __devexit tsc2005_remove(struct spi_device *spi)
input_unregister_device(ts->idev);
kfree(ts);
+ spi_set_drvdata(spi, NULL);
return 0;
}