summaryrefslogtreecommitdiff
path: root/arch/x86/events
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-10-13 10:18:12 +0300
committerIngo Molnar <mingo@kernel.org>2023-10-13 09:32:50 +0200
commit7543365739a4ff61d40ad53ab68c17d2e7dfb0c9 (patch)
tree6c56b451242e95923cd37230cebdbfa4dea98883 /arch/x86/events
parentdeedec0a152a3d7fa5b04ef9431aeb71802835b5 (diff)
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: d6389d3ccc13 ("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
Diffstat (limited to 'arch/x86/events')
-rw-r--r--arch/x86/events/amd/uncore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c
index 9b444ce24108..a389828f378c 100644
--- a/arch/x86/events/amd/uncore.c
+++ b/arch/x86/events/amd/uncore.c
@@ -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)