Commit d208d8c2 authored by Liang He's avatar Liang He Committed by Michael Ellerman

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: default avatarLiang He <windhl@126.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220622061652.4095330-1-windhl@126.com
parent 24156df0
...@@ -317,6 +317,7 @@ static void do_attach(struct i2c_adapter *adapter) ...@@ -317,6 +317,7 @@ static void do_attach(struct i2c_adapter *adapter)
if (x.running || strncmp(adapter->name, "uni-n", 5)) if (x.running || strncmp(adapter->name, "uni-n", 5))
return; return;
of_node_get(adapter->dev.of_node);
np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,ds1775"); np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,ds1775");
if (np) { if (np) {
of_node_put(np); of_node_put(np);
...@@ -325,6 +326,7 @@ static void do_attach(struct i2c_adapter *adapter) ...@@ -325,6 +326,7 @@ static void do_attach(struct i2c_adapter *adapter)
i2c_new_scanned_device(adapter, &info, scan_ds1775, NULL); 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"); np = of_find_compatible_node(adapter->dev.of_node, NULL, "MAC,adm1030");
if (np) { if (np) {
of_node_put(np); of_node_put(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment