perf/amd/uncore: Simplify code, use free_percpu()'s built-in check for NULL
authorKim Phillips <kim.phillips@amd.com>
Tue, 17 Aug 2021 22:10:44 +0000 (17:10 -0500)
committerIngo Molnar <mingo@kernel.org>
Thu, 26 Aug 2021 07:14:36 +0000 (09:14 +0200)
free_percpu() has its own check for NULL, no need to open-code it.

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210817221048.88063-5-kim.phillips@amd.com
arch/x86/events/amd/uncore.c

index 582c0ff..05bdb4c 100644 (file)
@@ -659,11 +659,9 @@ fail_prep:
 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;
 }