diff mbox series

[3/4] dt-overlay: Remove ASSERT_UNREACHABLE from add_nodes()

Message ID 20240919104238.232704-4-michal.orzel@amd.com (mailing list archive)
State New
Headers show
Series xen/arm: dt overlay fixes | expand

Commit Message

Michal Orzel Sept. 19, 2024, 10:42 a.m. UTC
The assumption stated in the comment that the code will never get there
is incorrect. It's enough for the target-path to be incorrect (i.e. user
error), which will lead to an incorrect overall node path and we will end
up in this "unreachable" place causing a failure in debug builds.

Fixes: 0c0facdab6f5 ("xen/arm: Implement device tree node addition functionalities")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/common/dt-overlay.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c
index 8606b14d1e8e..d18bd12bd38d 100644
--- a/xen/common/dt-overlay.c
+++ b/xen/common/dt-overlay.c
@@ -596,11 +596,7 @@  static long add_nodes(struct overlay_track *tr, char **nodes_full_path)
         overlay_node = dt_find_node_by_path_from(tr->dt_host_new,
                                                  nodes_full_path[j]);
         if ( overlay_node == NULL )
-        {
-            /* Sanity check. But code will never come here. */
-            ASSERT_UNREACHABLE();
             return -EFAULT;
-        }
 
         /*
          * Find previous and next node to overlay_node in dt_host_new. We will