:: commit f4f69c315f32cea0f5d8b758b0edf6ac0328cccd

Mintsuki <mintsuki@protonmail.com> — 2025-11-29 14:40

parents: 7d90dcb97a

misc: Hard panic when global DTB fails to load

diff --git a/common/lib/misc.c b/common/lib/misc.c
index f6ba4a58..8cb96dd3 100644
--- a/common/lib/misc.c
+++ b/common/lib/misc.c
@@ -147,16 +147,19 @@ void *get_device_tree_blob(const char *config, size_t extra_size) {
 
     {
         char *dtb_path = NULL;
+        bool soft_panic;
         if (config != NULL) {
             dtb_path = config_get_value(config, 0, "dtb_path");
+            soft_panic = true;
         }
         if (dtb_path == NULL) {
             dtb_path = config_get_value(NULL, 0, "global_dtb");
+            soft_panic = false;
         }
         if (dtb_path != NULL) {
             struct file_handle *dtb_file;
             if ((dtb_file = uri_open(dtb_path)) == NULL)
-                panic(true, "dtb: Failed to open device tree blob with path `%#`. Is the path correct?", dtb_path);
+                panic(soft_panic, "dtb: Failed to open device tree blob with path `%#`. Is the path correct?", dtb_path);
 
             dtb = freadall(dtb_file, MEMMAP_BOOTLOADER_RECLAIMABLE);
             size = dtb_file->size;
tab: 248 wrap: offon