[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140731060138.GB4844@core.coreip.homeip.net>
Date: Wed, 30 Jul 2014 23:01:38 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Pramod Gurav <pramod.gurav.etc@...il.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Pramod Gurav <pramod.gurav@...rtplayin.com>,
Lejun Zhu <lejun.zhu@...ux.intel.com>,
Sachin Kamat <sachin.kamat@...aro.org>
Subject: Re: [PATCH] input: ads7846: Release resources on failure for clean
exit
On Wed, Jul 30, 2014 at 11:24:37AM +0530, Pramod Gurav wrote:
> From: Pramod Gurav <pramod.gurav@...rtplayin.com>
>
> Input device must be released(input_free_device) when ads7846_probe_dt
> fails. This fixes the same by releasing resources on failure.
>
> CC: Dmitry Torokhov <dmitry.torokhov@...il.com>
> CC: Lejun Zhu <lejun.zhu@...ux.intel.com>
> CC: Sachin Kamat <sachin.kamat@...aro.org>
>
> Signed-off-by: Pramod Gurav <pramod.gurav@...rtplayin.com>
Applied, thank you.
> ---
> drivers/input/touchscreen/ads7846.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index da201b8..e57ba52 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;
> --
> 1.7.9.5
>
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists