[PATCH 1/3] mips: cpuinfo: fix cpu name output for unknown processors

Denis Orlov denorl2009 at gmail.com
Thu Mar 28 11:37:00 PDT 2024


Otherwise it would output <NULL> as __cpu_name global variable ends up
being a null pointer.

Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
---
 arch/mips/lib/cpu-probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/lib/cpu-probe.c b/arch/mips/lib/cpu-probe.c
index cbde43a595..47c9c671eb 100644
--- a/arch/mips/lib/cpu-probe.c
+++ b/arch/mips/lib/cpu-probe.c
@@ -17,7 +17,7 @@
 #include <asm-generic/memory_layout.h>
 #include <init.h>
 
-const char *__cpu_name;
+const char *__cpu_name = "unknown";
 struct cpuinfo_mips cpu_data[1];
 
 static char unknown_isa[] = KERN_ERR \
-- 
2.44.0




More information about the barebox mailing list