[kvmtool PATCH v3 07/10] riscv: Fix no params with nodefault segfault
Anup Patel
apatel at ventanamicro.com
Sat Apr 26 04:03:44 PDT 2025
From: Andrew Jones <ajones at ventanamicro.com>
Fix segfault received when using --nodefault without --params.
Fixes: 7c9aac003925 ("riscv: Generate FDT at runtime for Guest/VM")
Suggested-by: Alexandru Elisei <alexandru.elisei at arm.com>
Signed-off-by: Andrew Jones <ajones at ventanamicro.com>
Reviewed-by: Alexandru Elisei <alexandru.elisei at arm.com>
Link: https://lore.kernel.org/r/20250123151339.185908-2-ajones@ventanamicro.com
Signed-off-by: Anup Patel <apatel at ventanamicro.com>
---
riscv/fdt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/riscv/fdt.c b/riscv/fdt.c
index 3ee20a9..251821e 100644
--- a/riscv/fdt.c
+++ b/riscv/fdt.c
@@ -263,9 +263,10 @@ static int setup_fdt(struct kvm *kvm)
if (kvm->cfg.kernel_cmdline)
_FDT(fdt_property_string(fdt, "bootargs",
kvm->cfg.kernel_cmdline));
- } else
+ } else if (kvm->cfg.real_cmdline) {
_FDT(fdt_property_string(fdt, "bootargs",
kvm->cfg.real_cmdline));
+ }
_FDT(fdt_property_string(fdt, "stdout-path", "serial0"));
--
2.43.0
More information about the kvm-riscv
mailing list