linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macintosh: Add missing of_node_get() in do_attach()
@ 2022-06-22  6:16 Liang He
  2022-09-09 12:07 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Liang He @ 2022-06-22  6:16 UTC (permalink / raw)
  To: benh, christophe.leroy, mpe, windhl, linuxppc-dev

We need a of_node_get() for of_find_compatible_node() to keep refcount
balance.

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/macintosh/therm_windtunnel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index 9226b74fa08f..bee0510ab1df 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -317,6 +317,7 @@ static void do_attach(struct i2c_adapter *adapter)
 	if (x.running || strncmp(adapter->name, "uni-n", 5))
 		return;
 
+	of_node_get(adapter->dev.of_node);
 	np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,ds1775");
 	if (np) {
 		of_node_put(np);
@@ -325,6 +326,7 @@ static void do_attach(struct i2c_adapter *adapter)
 		i2c_new_scanned_device(adapter, &info, scan_ds1775, NULL);
 	}
 
+	of_node_get(adapter->dev.of_node);
 	np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,adm1030");
 	if (np) {
 		of_node_put(np);
-- 
2.25.1


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

* Re: [PATCH] macintosh: Add missing of_node_get() in do_attach()
  2022-06-22  6:16 [PATCH] macintosh: Add missing of_node_get() in do_attach() Liang He
@ 2022-09-09 12:07 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-09-09 12:07 UTC (permalink / raw)
  To: linuxppc-dev, Liang He, christophe.leroy, benh, mpe

On Wed, 22 Jun 2022 14:16:52 +0800, Liang He wrote:
> We need a of_node_get() for of_find_compatible_node() to keep refcount
> balance.
> 
> 

Applied to powerpc/next.

[1/1] macintosh: Add missing of_node_get() in do_attach()
      https://git.kernel.org/powerpc/c/d208d8c2cde513b94ae3b8b97663656079004555

cheers

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

end of thread, other threads:[~2022-09-09 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  6:16 [PATCH] macintosh: Add missing of_node_get() in do_attach() Liang He
2022-09-09 12:07 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).