Skip to content

Commit 6cf295b

Browse files
kimphillamdIngo Molnar
authored andcommitted
perf/amd/uncore: Simplify code, use free_percpu()'s built-in check for NULL
free_percpu() has its own check for NULL, no need to open-code it. Signed-off-by: Kim Phillips <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ffec09f commit 6cf295b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/x86/events/amd/uncore.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,9 @@ static int __init amd_uncore_init(void)
659659
fail_llc:
660660
if (boot_cpu_has(X86_FEATURE_PERFCTR_NB))
661661
perf_pmu_unregister(&amd_nb_pmu);
662-
if (amd_uncore_llc)
663-
free_percpu(amd_uncore_llc);
662+
free_percpu(amd_uncore_llc);
664663
fail_nb:
665-
if (amd_uncore_nb)
666-
free_percpu(amd_uncore_nb);
664+
free_percpu(amd_uncore_nb);
667665

668666
return ret;
669667
}

0 commit comments

Comments
 (0)