ARM: OMAP2+: pm33xx-core: ix device node reference leaks in amx3_idle_init

Add missing of_node_put() calls to release
device node references obtained via of_parse_phandle().

Fixes: 06ee7a950b ("ARM: OMAP2+: pm33xx-core: Add cpuidle_ops for am335x/am437x")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20250902075943.2408832-1-linmq006@gmail.com
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
This commit is contained in:
Miaoqian Lin 2025-09-02 15:59:43 +08:00 committed by Kevin Hilman
parent 045e81d8d7
commit 74139a64e8
1 changed files with 5 additions and 1 deletions

View File

@ -388,12 +388,15 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
if (!state_node) if (!state_node)
break; break;
if (!of_device_is_available(state_node)) if (!of_device_is_available(state_node)) {
of_node_put(state_node);
continue; continue;
}
if (i == CPUIDLE_STATE_MAX) { if (i == CPUIDLE_STATE_MAX) {
pr_warn("%s: cpuidle states reached max possible\n", pr_warn("%s: cpuidle states reached max possible\n",
__func__); __func__);
of_node_put(state_node);
break; break;
} }
@ -403,6 +406,7 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
states[state_count].wfi_flags |= WFI_FLAG_WAKE_M3 | states[state_count].wfi_flags |= WFI_FLAG_WAKE_M3 |
WFI_FLAG_FLUSH_CACHE; WFI_FLAG_FLUSH_CACHE;
of_node_put(state_node);
state_count++; state_count++;
} }