Commit 2721a89a authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarAaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent b88aa494
...@@ -634,8 +634,10 @@ static int __devinit tsc2005_probe(struct spi_device *spi) ...@@ -634,8 +634,10 @@ static int __devinit tsc2005_probe(struct spi_device *spi)
spi_setup(spi); spi_setup(spi);
r = tsc2005_setup(ts, pdata); r = tsc2005_setup(ts, pdata);
if (r) if (r) {
kfree(ts); kfree(ts);
spi_set_drvdata(spi, NULL);
}
return r; return r;
} }
...@@ -659,6 +661,7 @@ static int __devexit tsc2005_remove(struct spi_device *spi) ...@@ -659,6 +661,7 @@ static int __devexit tsc2005_remove(struct spi_device *spi)
input_unregister_device(ts->idev); input_unregister_device(ts->idev);
kfree(ts); kfree(ts);
spi_set_drvdata(spi, NULL);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment