Commit 75433657 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ingo Molnar

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: d6389d3c ("perf/x86/amd/uncore: Refactor uncore management")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/cec62eba-c4b8-4cb7-9671-58894dd4b974@moroto.mountain
parent deedec0a
...@@ -1009,7 +1009,8 @@ static struct amd_uncore uncores[UNCORE_TYPE_MAX] = { ...@@ -1009,7 +1009,8 @@ static struct amd_uncore uncores[UNCORE_TYPE_MAX] = {
static int __init amd_uncore_init(void) static int __init amd_uncore_init(void)
{ {
struct amd_uncore *uncore; struct amd_uncore *uncore;
int ret, i; int ret = -ENODEV;
int i;
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD && if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
boot_cpu_data.x86_vendor != X86_VENDOR_HYGON) boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment