Commit a40fdaf1 authored by Zhang Xiaoxu's avatar Zhang Xiaoxu Committed by Michael Ellerman

Revert "powerpc/pseries/hotplug-cpu: Remove double free in error path"

This reverts commit a0ff72f9.

Since the commit b015f6bc ("powerpc/pseries: Add cpu DLPAR
support for drc-info property"), the 'cpu_drcs' wouldn't be double
freed when the 'cpus' node not found.

So we needn't apply this patch, otherwise, the memory will be leaked.

Fixes: a0ff72f9 ("powerpc/pseries/hotplug-cpu: Remove double free in error path")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
[mpe: Caused by me applying a patch to a function that had changed in the interim]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201111020752.1686139-1-zhangxiaoxu5@huawei.com
parent 987c4263
...@@ -743,6 +743,7 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add) ...@@ -743,6 +743,7 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add)
parent = of_find_node_by_path("/cpus"); parent = of_find_node_by_path("/cpus");
if (!parent) { if (!parent) {
pr_warn("Could not find CPU root node in device tree\n"); pr_warn("Could not find CPU root node in device tree\n");
kfree(cpu_drcs);
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment