[PATCH 04/10] kvx: bootm: enforce existence of device tree
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed May 28 03:50:40 PDT 2025
Later commits will allow users to skip providing a device tree
when an empty file is passed, e.g. /dev/null.
Maintain existing behavior for kvx by translating the NULL return
from bootm_get_devicetree() that indicates this to an error pointer.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/kvx/lib/bootm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/kvx/lib/bootm.c b/arch/kvx/lib/bootm.c
index 33d714e873bc..6eba4054e500 100644
--- a/arch/kvx/lib/bootm.c
+++ b/arch/kvx/lib/bootm.c
@@ -84,6 +84,8 @@ static int do_boot_elf(struct image_data *data, struct elf_image *elf)
}
fdt = bootm_get_devicetree(data);
+ if (!fdt)
+ fdt = ERR_PTR(-EINVAL);
if (IS_ERR(fdt)) {
printf("Failed to load dtb\n");
return PTR_ERR(fdt);
--
2.39.5
More information about the barebox
mailing list