Shakeel Butt ab6a211443 x86/resctrl: Fix potential memory leak
set_cache_qos_cfg() is leaking memory when the given level is not
RDT_RESOURCE_L3 or RDT_RESOURCE_L2. At the moment, this function is
called with only valid levels but move the allocation after the valid
level checks in order to make it more robust and future proof.

 [ bp: Massage commit message. ]

Fixes: 99adde9b370de ("x86/intel_rdt: Enable L2 CDP in MSR IA32_L2_QOS_CFG")
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20200102165844.133133-1-shakeelb@google.com
2020-01-02 18:26:27 +01:00
..
2019-12-09 10:36:44 -08:00
2019-11-28 11:16:43 -08:00
2019-11-26 19:25:25 -08:00
2019-11-27 11:42:01 -08:00
2019-11-12 16:21:15 +01:00
2019-11-12 16:21:15 +01:00
2019-11-16 11:24:05 +01:00
2019-11-28 11:16:43 -08:00
2019-06-24 19:19:24 +02:00
2019-11-26 19:25:25 -08:00
2019-10-18 15:00:18 +02:00