aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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)
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