From: Pramod Gurav Date: Thu, 31 Jul 2014 05:48:24 +0000 (-0700) Subject: Input: ads7846 - release resources on failure for clean exit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a1cd3fd09a9b7de710d705127aa616946b567d72;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Dmitry Torokhov --- 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;