x86/resctrl: Free the ctrlval arrays when domain_setup_mon_state() fails
stable inclusion from linux-4.19.213 commit f961a224e73138a93f4df8503ecd8c6928291c53 -------------------------------- commit 64e87d4b upstream. 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: 1bd2a63b ("x86/intel_rdt/mba_sc: Add initialization support") Fixes: edf6fa1c ("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 Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by:
Jason Yan <yanaijie@huawei.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Loading
Please sign in to comment