diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-17 01:09:09 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-03-17 02:28:23 -0400 |
commit | 2721a89ac41f2e7705484c1582c293c4eee5344d (patch) | |
tree | bf9631ffaa8364e360bdb38d8ea32fc234e5972b /drivers | |
parent | b88aa494c27552e6fa94e4abaa5ea4f9b2f170a8 (diff) |
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')
-rw-r--r-- | drivers/input/touchscreen/tsc2005.c | 5 |
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) | |||
634 | spi_setup(spi); | 634 | spi_setup(spi); |
635 | 635 | ||
636 | r = tsc2005_setup(ts, pdata); | 636 | r = tsc2005_setup(ts, pdata); |
637 | if (r) | 637 | if (r) { |
638 | kfree(ts); | 638 | kfree(ts); |
639 | spi_set_drvdata(spi, NULL); | ||
640 | } | ||
639 | return r; | 641 | return r; |
640 | } | 642 | } |
641 | 643 | ||
@@ -659,6 +661,7 @@ static int __devexit tsc2005_remove(struct spi_device *spi) | |||
659 | input_unregister_device(ts->idev); | 661 | input_unregister_device(ts->idev); |
660 | kfree(ts); | 662 | kfree(ts); |
661 | 663 | ||
664 | spi_set_drvdata(spi, NULL); | ||
662 | return 0; | 665 | return 0; |
663 | } | 666 | } |
664 | 667 | ||