public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] input/serio: Fix refcount leak bug in i8042-sparcio
@ 2022-06-19  7:30 Liang He
  2022-07-09  4:49 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Liang He @ 2022-06-19  7:30 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: windhl, linux-input, linux-kernel

In i8042_platform_init() and i8042_platform_exit(), we need call
of_node_put() to keep refcount balance.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/input/serio/i8042-sparcio.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index fce76812843b..a2a9db9220d7 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -108,6 +108,8 @@ static int __init i8042_platform_init(void)
 	struct device_node *root = of_find_node_by_path("/");
 	const char *name = of_get_property(root, "name", NULL);
 
+	of_node_put(root);
+
 	if (name && !strcmp(name, "SUNW,JavaStation-1")) {
 		/* Hardcoded values for MrCoffee.  */
 		i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
@@ -139,6 +141,8 @@ static inline void i8042_platform_exit(void)
 	struct device_node *root = of_find_node_by_path("/");
 	const char *name = of_get_property(root, "name", NULL);
 
+	of_node_put(root);
+
 	if (!name || strcmp(name, "SUNW,JavaStation-1"))
 		platform_driver_unregister(&sparc_i8042_driver);
 }
-- 
2.25.1


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

end of thread, other threads:[~2022-07-11  4:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-19  7:30 [PATCH] input/serio: Fix refcount leak bug in i8042-sparcio Liang He
2022-07-09  4:49 ` Dmitry Torokhov
2022-07-10  1:37   ` Liang He
2022-07-11  3:19     ` Dmitry Torokhov
2022-07-11  4:57       ` Liang He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox