diff options
author | Liang He <windhl@126.com> | 2022-06-22 14:16:52 +0800 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-09-05 17:30:24 +1000 |
commit | d208d8c2cde513b94ae3b8b97663656079004555 (patch) | |
tree | ab5c92731d32f9d2a4affc36ee6d9adfdd57c367 /drivers/macintosh | |
parent | 24156df00dbbc673d9b2d31a336c3aba537d2c60 (diff) |
macintosh: Add missing of_node_get() in do_attach()
We need a of_node_get() for of_find_compatible_node() to keep refcount
balance.
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220622061652.4095330-1-windhl@126.com
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/therm_windtunnel.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 091278240baa..5cd9671b2e3d 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); |