summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorPramod Gurav <pramod.gurav@smartplayin.com>2014-07-30 22:48:24 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-30 22:52:09 -0700
commita1cd3fd09a9b7de710d705127aa616946b567d72 (patch)
tree524cf610fa9fccc34adca9d03e209bab20cdcac1 /drivers/input
parent9d469d033d135d80742a4e39e6bbb4519dd5eee1 (diff)
downloadlinux-a1cd3fd09a9b7de710d705127aa616946b567d72.tar.bz2
Input: ads7846 - release resources on failure for clean exit
Input device must be released(input_free_device) when ads7846_probe_dt fails. This fixes the same by releasing resources on failure. Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ads7846.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index da201b8e37dc..e57ba52bf484 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1302,8 +1302,10 @@ static int ads7846_probe(struct spi_device *spi)
pdata = dev_get_platdata(&spi->dev);
if (!pdata) {
pdata = ads7846_probe_dt(&spi->dev);
- if (IS_ERR(pdata))
- return PTR_ERR(pdata);
+ if (IS_ERR(pdata)) {
+ err = PTR_ERR(pdata);
+ goto err_free_mem;
+ }
}
ts->model = pdata->model ? : 7846;