summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/cpu/cpu_x86.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c
index 8be14b5..b465b14 100644
--- a/arch/x86/cpu/cpu_x86.c
+++ b/arch/x86/cpu/cpu_x86.c
@@ -41,10 +41,14 @@ int cpu_x86_get_vendor(struct udevice *dev, char *buf, int size)
int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
{
+ char *ptr;
+
if (size < CPU_MAX_NAME_LEN)
return -ENOSPC;
- cpu_get_name(buf);
+ ptr = cpu_get_name(buf);
+ if (ptr != buf)
+ strcpy(buf, ptr);
return 0;
}