Skip to content

Commit 74139a6

Browse files
Yuuoniykhilman
authored andcommitted
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: 06ee7a9 ("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>
1 parent 045e81d commit 74139a6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

arch/arm/mach-omap2/pm33xx-core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,15 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
388388
if (!state_node)
389389
break;
390390

391-
if (!of_device_is_available(state_node))
391+
if (!of_device_is_available(state_node)) {
392+
of_node_put(state_node);
392393
continue;
394+
}
393395

394396
if (i == CPUIDLE_STATE_MAX) {
395397
pr_warn("%s: cpuidle states reached max possible\n",
396398
__func__);
399+
of_node_put(state_node);
397400
break;
398401
}
399402

@@ -403,6 +406,7 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
403406
states[state_count].wfi_flags |= WFI_FLAG_WAKE_M3 |
404407
WFI_FLAG_FLUSH_CACHE;
405408

409+
of_node_put(state_node);
406410
state_count++;
407411
}
408412

0 commit comments

Comments
 (0)