lkml.org 
[lkml]   [2016]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Input: gpio_keys_polled - fix DT node reference leak
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

\
 
 \ /
  Last update: 2016-10-21 11:02    [W:0.047 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site