From e480a14f399ef5f552c0940b0cb04a6f7d00503b Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Tue, 17 Aug 2021 17:10:44 -0500 Subject: [PATCH] perf/amd/uncore: Simplify code, use free_percpu()'s built-in check for NULL mainline inclusion from mainline-v5.15-rc1 commit 6cf295b21608f9253037335f47cd0dfcce812d81 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65D55 CVE: NA -------------------------------- free_percpu() has its own check for NULL, no need to open-code it. Signed-off-by: Kim Phillips Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210817221048.88063-5-kim.phillips@amd.com Signed-off-by: Xie Haocheng --- arch/x86/events/amd/uncore.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index e8797397f108..77807f0b8703 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -755,11 +755,9 @@ static int __init amd_uncore_init(void) fail_llc: if (boot_cpu_has(X86_FEATURE_PERFCTR_NB)) perf_pmu_unregister(&amd_nb_pmu); - if (amd_uncore_llc) - free_percpu(amd_uncore_llc); + free_percpu(amd_uncore_llc); fail_nb: - if (amd_uncore_nb) - free_percpu(amd_uncore_nb); + free_percpu(amd_uncore_nb); return ret; } -- GitLab