Skip to content

Commit 744940f

Browse files
sandip4nIngo Molnar
authored and
Ingo Molnar
committed
perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV
Pass through the appropriate error code when the registration of hotplug callbacks fail during initialization, instead of returning a blanket -ENODEV. [ mingo: Updated the changelog. ] Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Sandipan Das <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7543365 commit 744940f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

arch/x86/events/amd/uncore.c

+15-10
Original file line numberDiff line numberDiff line change
@@ -1040,20 +1040,25 @@ static int __init amd_uncore_init(void)
10401040
/*
10411041
* Install callbacks. Core will call them for each online cpu.
10421042
*/
1043-
if (cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP,
1044-
"perf/x86/amd/uncore:prepare",
1045-
NULL, amd_uncore_cpu_dead))
1043+
ret = cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP,
1044+
"perf/x86/amd/uncore:prepare",
1045+
NULL, amd_uncore_cpu_dead);
1046+
if (ret)
10461047
goto fail;
10471048

1048-
if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
1049-
"perf/x86/amd/uncore:starting",
1050-
amd_uncore_cpu_starting, NULL))
1049+
ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
1050+
"perf/x86/amd/uncore:starting",
1051+
amd_uncore_cpu_starting, NULL);
1052+
if (ret)
10511053
goto fail_prep;
1052-
if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
1053-
"perf/x86/amd/uncore:online",
1054-
amd_uncore_cpu_online,
1055-
amd_uncore_cpu_down_prepare))
1054+
1055+
ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
1056+
"perf/x86/amd/uncore:online",
1057+
amd_uncore_cpu_online,
1058+
amd_uncore_cpu_down_prepare);
1059+
if (ret)
10561060
goto fail_start;
1061+
10571062
return 0;
10581063

10591064
fail_start:

0 commit comments

Comments
 (0)