]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries/hotplug-cpu: Remove double free in error path
authorNathan Lynch <nathanl@linux.ibm.com>
Thu, 19 Sep 2019 23:16:33 +0000 (18:16 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 30 Jul 2020 12:53:49 +0000 (22:53 +1000)
commit6e71a10d031abcc2fbe8e354ec39ccab4ed558c8
treeb5adb262650b6d0866fe75ab730f9b4061ffdfa6
parentd0a364b95376874061cd141824bad76120b124e0
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: fa0799b7bb80 ("powerpc/pseries: Add CPU dlpar add functionality")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190919231633.1344-1-nathanl@linux.ibm.com
arch/powerpc/platforms/pseries/hotplug-cpu.c