Skip to content

Commit

Permalink
perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@linaro.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/cec62eba-c4b8-4cb7-9671-58894dd4b974@moroto.mountain
  • Loading branch information
Dan Carpenter authored and Ingo Molnar committed Oct 13, 2023
1 parent deedec0 commit 7543365
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/events/amd/uncore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,8 @@ static struct amd_uncore uncores[UNCORE_TYPE_MAX] = {
static int __init amd_uncore_init(void)
{
struct amd_uncore *uncore;
int ret, i;
int ret = -ENODEV;
int i;

if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
Expand Down

0 comments on commit 7543365

Please sign in to comment.