Skip to content

Commit a0ff72f

Browse files
nathanlynchmpe
authored andcommitted
powerpc/pseries/hotplug-cpu: Remove double free in error path
In the unlikely event that the device tree lacks a /cpus node, find_dlpar_cpus_to_add() oddly frees the cpu_drcs buffer it has been passed before returning an error. Its only caller also frees the buffer on error. Remove the less conventional kfree() of a caller-supplied buffer from find_dlpar_cpus_to_add(). Fixes: 90edf18 ("powerpc/pseries: Add CPU dlpar add functionality") Signed-off-by: Nathan Lynch <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5d8b1f9 commit a0ff72f

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/powerpc/platforms/pseries/hotplug-cpu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add)
737737
parent = of_find_node_by_path("/cpus");
738738
if (!parent) {
739739
pr_warn("Could not find CPU root node in device tree\n");
740-
kfree(cpu_drcs);
741740
return -1;
742741
}
743742

0 commit comments

Comments
 (0)