FAILED: patch "[PATCH] x86/resctrl: Free the ctrlval arrays when" failed to apply to 5.10-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 64e87d4bd3201bf8a4685083ee4daf5c0d001452 Mon Sep 17 00:00:00 2001
From: James Morse <[email protected]>
Date: Fri, 17 Sep 2021 16:59:58 +0000
Subject: [PATCH] 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.
arch/x86/kernel/cpu/resctrl/core.c +2 -0
@@ -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 ; }