linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/x86/amd/uncore: fix error codes in amd_uncore_init()
@ 2023-10-13  7:18 Dan Carpenter
  2023-10-13  7:30 ` Ingo Molnar
  2023-10-13  7:44 ` Sandipan Das
  0 siblings, 2 replies; 11+ messages in thread
From: Dan Carpenter @ 2023-10-13  7:18 UTC (permalink / raw)
  To: Sandipan Das
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Thomas Gleixner, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, linux-perf-users, linux-kernel,
	kernel-janitors

Some of the error paths in this function return don't initialize the
error code.  Return -ENODEV.

Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 arch/x86/events/amd/uncore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-10-16 11:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-13  7:18 [PATCH] perf/x86/amd/uncore: fix error codes in amd_uncore_init() Dan Carpenter
2023-10-13  7:30 ` Ingo Molnar
2023-10-13  8:12   ` Dan Carpenter
2023-10-13  9:06     ` Ingo Molnar
2023-10-13  9:09       ` Uros Bizjak
2023-10-14  9:03         ` Ingo Molnar
2023-10-16 10:39           ` Dan Carpenter
2023-10-16 11:18             ` Ingo Molnar
2023-10-13  7:44 ` Sandipan Das
2023-10-13  9:03   ` Ingo Molnar
2023-10-13  9:07     ` Sandipan Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).