[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] dt-overlay: Remove ASSERT_UNREACHABLE from add_nodes()



commit 81862825e8139a81c51fece39a05768736e4bf5d
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Fri Oct 4 14:22:17 2024 +0200
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Oct 10 16:18:56 2024 +0100

    dt-overlay: Remove ASSERT_UNREACHABLE from add_nodes()
    
    The assumption stated in the comment that the code will never get there
    is incorrect. In overlay_get_nodes_info() we manually combine path from
    target-path property with the node path by adding '/' as a separator.
    This can differ from a path obtained by libfdt due to more advanced
    logic used there which can for instance get rid of excessive slashes.
    In case of incorrect target-path (e.g. target-path = "//axi"), the
    comparison in dt_find_node_by_path_from() can fail triggering the assert
    in debug builds.
    
    Fixes: 0c0facdab6f5 ("xen/arm: Implement device tree node addition 
functionalities")
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/common/dt-overlay.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c
index 8606b14d1e..d18bd12bd3 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
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.