summaryrefslogtreecommitdiff
path: root/drivers/cpu
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-05-14 07:45:49 -0600
committerTom Rini <[email protected]>2024-05-14 07:45:49 -0600
commit676903c1b97578a82c82a40293d4939cf687d9d9 (patch)
tree9a593aaa8cd82edb4c23146ebcfdc748e2e5a484 /drivers/cpu
parentd456f2fc54ebfa4215b310594b85b34d127c3b14 (diff)
parent2b8dc36b4c515979da330a96d9fcc9bbbe5385fa (diff)
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/20690 - RISC-V: Add NULL check after parsing compatible string - Board: Add Milk-V Mars CM board - Andes: Unify naming policy
Diffstat (limited to 'drivers/cpu')
-rw-r--r--drivers/cpu/riscv_cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c
index 4f2958a23ce..4fff4658b5f 100644
--- a/drivers/cpu/riscv_cpu.c
+++ b/drivers/cpu/riscv_cpu.c
@@ -23,7 +23,7 @@ static int riscv_cpu_get_desc(const struct udevice *dev, char *buf, int size)
const char *cpu;
cpu = dev_read_string(dev, "compatible");
- if (size < (strlen(cpu) + 1))
+ if (!cpu || size < (strlen(cpu) + 1))
return -ENOSPC;
strcpy(buf, cpu);