[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <163336605365.25758.3996074729220568354.tip-bot2@tip-bot2>
Date: Mon, 04 Oct 2021 16:47:33 -0000
From: "tip-bot2 for James Morse" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: James Morse <james.morse@....com>, Borislav Petkov <bp@...e.de>,
Reinette Chatre <reinette.chatre@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/urgent] x86/resctrl: Free the ctrlval arrays when
domain_setup_mon_state() fails
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 7adeda06ac6c30d6f13f474974225143ff1eecf3
Gitweb: https://git.kernel.org/tip/7adeda06ac6c30d6f13f474974225143ff1eecf3
Author: James Morse <james.morse@....com>
AuthorDate: Fri, 17 Sep 2021 16:59:58
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Mon, 04 Oct 2021 18:32:08 +02:00
x86/resctrl: Free the ctrlval arrays when domain_setup_mon_state() fails
domain_add_cpu() is called whenever a CPU is brought online. The
earlier call to domain_setup_ctrlval() allocates the control value
arrays.
If domain_setup_mon_state() fails, the control value arrays are not
freed.
Add the missing kfree() calls.
Fixes: 1bd2a63b4f0de ("x86/intel_rdt/mba_sc: Add initialization support")
Fixes: edf6fa1c4a951 ("x86/intel_rdt/cqm: Add RMID (Resource monitoring ID) management")
Signed-off-by: James Morse <james.morse@....com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Acked-by: Reinette Chatre <reinette.chatre@...el.com>
Link: https://lkml.kernel.org/r/20210917165958.28313-1-james.morse@arm.com
---
arch/x86/kernel/cpu/resctrl/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 4b8813b..b5de5a6 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -532,6 +532,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
}
if (r->mon_capable && domain_setup_mon_state(r, d)) {
+ kfree(hw_dom->ctrl_val);
+ kfree(hw_dom->mbps_val);
kfree(d);
return;
}
Powered by blists - more mailing lists