powerpc/pseries: fix potential memory leak in init_cpu_associativity()
authorWang Yufen <wangyufen@huawei.com>
Wed, 14 Dec 2022 07:46:23 +0000 (15:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:52:12 +0000 (11:52 +0100)
commitabdd1f47efaec13138155e5b25b16eacad91a4fd
tree2f61ebf7a4ddc1d15987aa002f07a5a95bdd130e
parent257517c00b5718adacfd3d4d445fe935c2749f4b
powerpc/pseries: fix potential memory leak in init_cpu_associativity()

[ Upstream commit 95f1a128cd728a7257d78e868f1f5a145fc43736 ]

If the vcpu_associativity alloc memory successfully but the
pcpu_associativity fails to alloc memory, the vcpu_associativity
memory leaks.

Fixes: d62c8deeb6e6 ("powerpc/pseries: Provide vcpu dispatch statistics")
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
Reviewed-by: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/1671003983-10794-1-git-send-email-wangyufen@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/pseries/lpar.c