]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/arm: Check return code from recursive calls to scan_pfdt_node()
authorMichal Orzel <michal.orzel@amd.com>
Mon, 16 Oct 2023 12:45:59 +0000 (14:45 +0200)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 17 Oct 2023 21:01:03 +0000 (14:01 -0700)
At the moment, we do not check a return code from scan_pfdt_node()
called recursively. This means that any issue that may occur while
parsing and copying the passthrough nodes is hidden and Xen continues
to boot a domain despite errors. This may lead to incorrect device tree
generation and various guest issues (e.g. trap on attempt to access MMIO
not mapped in P2M). Fix it.

Fixes: 669ecdf8d6cd ("xen/arm: copy dtb fragment to guest dtb")
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/arm/domain_build.c

index 24c9019cc43ca2d4963c3a6f8645939e26056cd0..49792dd590ee93c03df93e362b98618e0fde197c 100644 (file)
@@ -2872,8 +2872,11 @@ static int __init scan_pfdt_node(struct kernel_info *kinfo, const void *pfdt,
     node_next = fdt_first_subnode(pfdt, nodeoff);
     while ( node_next > 0 )
     {
-        scan_pfdt_node(kinfo, pfdt, node_next, address_cells, size_cells,
-                       scan_passthrough_prop);
+        rc = scan_pfdt_node(kinfo, pfdt, node_next, address_cells, size_cells,
+                            scan_passthrough_prop);
+        if ( rc )
+            return rc;
+
         node_next = fdt_next_subnode(pfdt, node_next);
     }