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:
Ian Campbell committed 2014-03-14 14:56:22 +00:00
1 parent adf8340b3f
commit 3647a486ec
1 file changed
+4 -2
+4 -2
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.