mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified
Otherwise we deference a NULL pointer. I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Julien Grall <julien.grall@linaro.org> Cc: george.dunlap@citrix.com>
This commit is contained in:
1 parent
adf8340b3f
commit
3647a486ec
1 file changed
+4
-2
@@ -164,8 +164,10 @@ static int make_chosen_node(libxl__gc *gc, void *fdt,
|
||||
res = fdt_begin_node(fdt, "chosen");
|
||||
if (res) return res;
|
||||
|
||||
res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
|
||||
if (res) return res;
|
||||
if (info->u.pv.cmdline) {
|
||||
res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline);
|
||||
if (res) return res;
|
||||
}
|
||||
|
||||
res = fdt_end_node(fdt);
|
||||
if (res) return res;
|
||||
|
||||