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-Tag: firefly_0821_release~176^2~541^2~171^2~8 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a1cd3fd09a9b7de710d705127aa616946b567d72;p=firefly-linux-kernel-4.4.55.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;