Skip to content

Commit 92606ec

Browse files
tasksetwildea01
authored andcommitted
arm64: cpu_ops: fix a leaked reference by adding missing of_node_put
The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm64/kernel/cpu_ops.c:102:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 69, but without a corresponding object release within this function. Signed-off-by: Wen Yang <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 7048a59 commit 92606ec

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

arch/arm64/kernel/cpu_ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ static const char *__init cpu_read_enable_method(int cpu)
8585
pr_err("%pOF: missing enable-method property\n",
8686
dn);
8787
}
88+
of_node_put(dn);
8889
} else {
8990
enable_method = acpi_get_enable_method(cpu);
9091
if (!enable_method) {

0 commit comments

Comments
 (0)