Skip to content

Commit 7543365

Browse files
Dan CarpenterIngo Molnar
Dan Carpenter
authored and
Ingo Molnar
committed
perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init()
Some of the error paths in this function return don't initialize the error code. Return -ENODEV by default. Fixes: d6389d3 ("perf/x86/amd/uncore: Refactor uncore management") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent deedec0 commit 7543365

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/events/amd/uncore.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,8 @@ static struct amd_uncore uncores[UNCORE_TYPE_MAX] = {
10091009
static int __init amd_uncore_init(void)
10101010
{
10111011
struct amd_uncore *uncore;
1012-
int ret, i;
1012+
int ret = -ENODEV;
1013+
int i;
10131014

10141015
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
10151016
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)

0 commit comments

Comments
 (0)