mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
powerpc/pseries: fix potential memory leak in init_cpu_associativity()
[ Upstream commit95f1a128cd
] If the vcpu_associativity alloc memory successfully but the pcpu_associativity fails to alloc memory, the vcpu_associativity memory leaks. Fixes:d62c8deeb6
("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>
This commit is contained in:
parent
c3ff87e536
commit
e9643291b3
1 changed files with 3 additions and 1 deletions
|
@ -526,8 +526,10 @@ static ssize_t vcpudispatch_stats_write(struct file *file, const char __user *p,
|
|||
|
||||
if (cmd) {
|
||||
rc = init_cpu_associativity();
|
||||
if (rc)
|
||||
if (rc) {
|
||||
destroy_cpu_associativity();
|
||||
goto out;
|
||||
}
|
||||
|
||||
for_each_possible_cpu(cpu) {
|
||||
disp = per_cpu_ptr(&vcpu_disp_data, cpu);
|
||||
|
|
Loading…
Reference in a new issue