soc: dove: add missing of_node_put before break
PATCH 1/1 soc: dove: add missing of_node_put before break
From: Wang Qing <[email protected]>
Fix following coccicheck warning:
WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return.
Early exits from for_each_available_child_of_node should decrement the node reference counter.
Signed-off-by Wang Qing <[email protected]>
--- drivers/soc/dove/pmu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/dove/pmu.c +4 -1
@@ -410,13 +410,16 @@ int __init dove_init_pmu(void)struct pmu_domain *domain; domain =kzalloc (sizeof (*domain),GFP_KERNEL ); -if (!domain) +if (!domain) { +of_node_put (np);break ; + } domain->pmu = pmu; domain->base.name =kasprintf (GFP_KERNEL ,"%pOFn" , np);if (!domain->base.name) {kfree (domain); +of_node_put (np);break ; }
Signature · 7 lines
2.7.4 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel