History

ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init()

In rockchip_suspend_init(), of_find_matching_node_and_match() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore.

Liang He committed 4 years ago

Commit f4470db1 parent f2906aa1 file · +5 −2Browse files

Unified · Split

arch/arm/mach-rockchip/pm.c+5−2
@@ -311,7 +311,7 @@ void __init rockchip_suspend_init(void) · 310 unmodified lines
311311 &match);
312312 if (!match) {
313313 pr_err("Failed to find PMU node\n");
314− return;
314+ goto out_put;
315315 }
316316 pm_data = (struct rockchip_pm_data *) match->data;
317317
@@ -320,9 +320,12 @@ void __init rockchip_suspend_init(void) · 2 unmodified lines
320320
321321 if (ret) {
322322 pr_err("%s: matches init error %d\n", __func__, ret);
323− return;
323+ goto out_put;
324324 }
325325 }
326326
327327 suspend_set_ops(pm_data->ops);
328+
329+out_put:
330+ of_node_put(np);
328331 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t