From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Pramod Gurav <pramod.gurav.etc@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Pramod Gurav <pramod.gurav@smartplayin.com>,
Lejun Zhu <lejun.zhu@linux.intel.com>,
Sachin Kamat <sachin.kamat@linaro.org>
Subject: Re: [PATCH] input: ads7846: Release resources on failure for clean exit
Date: Wed, 30 Jul 2014 23:01:38 -0700 [thread overview]
Message-ID: <20140731060138.GB4844@core.coreip.homeip.net> (raw)
In-Reply-To: <1406699677-1347-1-git-send-email-pramod.gurav.etc@gmail.com>
On Wed, Jul 30, 2014 at 11:24:37AM +0530, Pramod Gurav wrote:
> From: Pramod Gurav <pramod.gurav@smartplayin.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@gmail.com>
> CC: Lejun Zhu <lejun.zhu@linux.intel.com>
> CC: Sachin Kamat <sachin.kamat@linaro.org>
>
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.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
prev parent reply other threads:[~2014-07-31 6:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-30 5:54 Pramod Gurav
2014-07-31 6:01 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140731060138.GB4844@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=lejun.zhu@linux.intel.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pramod.gurav.etc@gmail.com \
--cc=pramod.gurav@smartplayin.com \
--cc=sachin.kamat@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®