
15 Jan
2020
15 Jan
'20
11:55 p.m.
The riscv_cpu_get_info function does not always zero-out cpu_freq. This can cause spurious higher frequencies.
Signed-off-by Sean Anderson seanga2@gmail.com --- Changes for v2: New.
drivers/cpu/riscv_cpu.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/cpu/riscv_cpu.c b/drivers/cpu/riscv_cpu.c index 28ad0aa30f..1e32bb5678 100644 --- a/drivers/cpu/riscv_cpu.c +++ b/drivers/cpu/riscv_cpu.c @@ -29,6 +29,8 @@ static int riscv_cpu_get_info(struct udevice *dev, struct cpu_info *info) { const char *mmu;
+ /* Zero out the frequency, in case sizeof(ulong) != sizeof(u32) */ + info->cpu_freq = 0; dev_read_u32(dev, "clock-frequency", (u32 *)&info->cpu_freq);
mmu = dev_read_string(dev, "mmu-type");
--
2.24.1