Skip to content

Commit 64e87d4

Browse files
James Morsesuryasaimadhu
authored andcommitted
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: 1bd2a63 ("x86/intel_rdt/mba_sc: Add initialization support") Fixes: edf6fa1 ("x86/intel_rdt/cqm: Add RMID (Resource monitoring ID) management") Signed-off-by: James Morse <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Reinette Chatre <[email protected]> Cc: <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 6e3cd95 commit 64e87d4

File tree

1 file changed

+2
-0
lines changed
  • arch/x86/kernel/cpu/resctrl

1 file changed

+2
-0
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
532532
}
533533

534534
if (r->mon_capable && domain_setup_mon_state(r, d)) {
535+
kfree(hw_dom->ctrl_val);
536+
kfree(hw_dom->mbps_val);
535537
kfree(d);
536538
return;
537539
}

0 commit comments

Comments
 (0)