All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: gpio_keys_polled - fix DT node reference leak
Date: Fri, 21 Oct 2016 12:02:35 +0300	[thread overview]
Message-ID: <20161021090235.GS24289@lahna.fi.intel.com> (raw)
In-Reply-To: <20161020220636.GA17948@dtor-ws>

On Thu, Oct 20, 2016 at 03:06:36PM -0700, Dmitry Torokhov wrote:
> When someone requests button with wakeup (which this driver does not
> support) we should drop reference to the current child device node before
> returning error.
> 
> Note that when we using legacy platform data 'child' stays NULL which
> fwnode_handle_put() handles just fine.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/input/keyboard/gpio_keys_polled.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
> index 270dcf7..72b3503 100644
> --- a/drivers/input/keyboard/gpio_keys_polled.c
> +++ b/drivers/input/keyboard/gpio_keys_polled.c
> @@ -291,6 +291,7 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
>  
>  		if (button->wakeup) {
>  			dev_err(dev, DRV_NAME " does not support wakeup\n");
> +			fwnode_handle_put(child);

Are you sure this is the right place?

I didn't try to compile this but to me it looks like there is no
variable named "child" in the whole gpio_keys_polled_probe() function.
Unless I'm looking at wrong branch ;-)

>  			return -EINVAL;
>  		}
>  
> -- 
> 2.8.0.rc3.226.g39d4020
> 
> 
> -- 
> Dmitry

  reply	other threads:[~2016-10-21  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20 22:06 [PATCH] Input: gpio_keys_polled - fix DT node reference leak Dmitry Torokhov
2016-10-21  9:02 ` Mika Westerberg [this message]
2016-10-27  1:08   ` Dmitry Torokhov

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=20161021090235.GS24289@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.