Skip to content

Commit a1202b7

Browse files
Yuuoniygregkh
authored andcommitted
ARM: OMAP2+: pm33xx-core: ix device node reference leaks in amx3_idle_init
commit 74139a6 upstream. 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: [email protected] Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kevin Hilman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e9d7803 commit a1202b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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)