]> git.baikalelectronics.ru Git - kernel.git/commit
x86/resctrl: Free the ctrlval arrays when domain_setup_mon_state() fails
authorJames Morse <james.morse@arm.com>
Fri, 17 Sep 2021 16:59:58 +0000 (16:59 +0000)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Oct 2021 16:45:21 +0000 (18:45 +0200)
commitd213be1bb9ed331ee1f8f87d290ca5e4a05da171
tree9e7fd91b089d386d996ae1b3b4a38639e4abdc4c
parentb6c7ddc3fc4c8b1e72077ef0ae94da99f139ed22
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: b5bcc17ddf518 ("x86/intel_rdt/mba_sc: Add initialization support")
Fixes: f9ebb9951a101 ("x86/intel_rdt/cqm: Add RMID (Resource monitoring ID) management")
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20210917165958.28313-1-james.morse@arm.com
arch/x86/kernel/cpu/resctrl/core.c