All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: gpio_keys_polled - fix DT node reference leak
@ 2016-10-20 22:06 Dmitry Torokhov
  2016-10-21  9:02 ` Mika Westerberg
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2016-10-20 22:06 UTC (permalink / raw)
  To: linux-input
  Cc: Linus Walleij, Hans de Goede, Mika Westerberg,
	Geert Uytterhoeven, linux-kernel

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);
 			return -EINVAL;
 		}
 
-- 
2.8.0.rc3.226.g39d4020


-- 
Dmitry

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-27  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-20 22:06 [PATCH] Input: gpio_keys_polled - fix DT node reference leak Dmitry Torokhov
2016-10-21  9:02 ` Mika Westerberg
2016-10-27  1:08   ` Dmitry Torokhov

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.