Skip to content

Commit

Permalink
perf/amd/uncore: Simplify code, use free_percpu()'s built-in check fo…
Browse files Browse the repository at this point in the history
…r 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]
  • Loading branch information
kimphillamd authored and Ingo Molnar committed Aug 26, 2021
1 parent ffec09f commit 6cf295b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/x86/events/amd/uncore.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,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;
}
Expand Down

0 comments on commit 6cf295b

Please sign in to comment.