arm: mach-rockchip: Add missing of_node_put
Subsystems (3)
PATCH 1/1 arm: mach-rockchip: Add missing of_node_put
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 the pointer is not used anymore.
Signed-off-by heliang <[email protected]>
--- arch/arm/mach-rockchip/pm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/pm.c +3 -1
@@ -310,6 +310,7 @@ void __init rockchip_suspend_init(void) np =of_find_matching_node_and_match (NULL , rockchip_pmu_of_device_ids, &match);if (!match) { +of_node_put (np);pr_err ("Failed to find PMU node\n" );return ; }
@@ -319,10 +320,11 @@ void __init rockchip_suspend_init(void) ret = pm_data->init (np);if (ret) { +of_node_put (np);pr_err ("%s: matches init error %d\n" , __func__, ret);return ; } } - +of_node_put (np);suspend_set_ops (pm_data->ops); }
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel