Commit 7a9f743c authored by Liang He's avatar Liang He Committed by Thomas Bogendoerfer

mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start

We should call of_node_put() for the reference 'uctl_node' returned by
of_get_parent() which will increase the refcount. Otherwise, there will
be a refcount leak bug.
Signed-off-by: default avatarLiang He <windhl@126.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 5f7e2f3e
...@@ -86,11 +86,12 @@ static void octeon2_usb_clocks_start(struct device *dev) ...@@ -86,11 +86,12 @@ static void octeon2_usb_clocks_start(struct device *dev)
"refclk-frequency", &clock_rate); "refclk-frequency", &clock_rate);
if (i) { if (i) {
dev_err(dev, "No UCTL \"refclk-frequency\"\n"); dev_err(dev, "No UCTL \"refclk-frequency\"\n");
of_node_put(uctl_node);
goto exit; goto exit;
} }
i = of_property_read_string(uctl_node, i = of_property_read_string(uctl_node,
"refclk-type", &clock_type); "refclk-type", &clock_type);
of_node_put(uctl_node);
if (!i && strcmp("crystal", clock_type) == 0) if (!i && strcmp("crystal", clock_type) == 0)
is_crystal_clock = true; is_crystal_clock = true;
} }
......
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