The current implementation casts an address to a pointer. Make it more
sandbox-friendly by using map_sysmem().

Signed-off-by: Nikita Shubin <[email protected]>
---
 common/spl/spl_fit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 18bff7b8d4a..4d4a96d1c4c 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -1034,9 +1034,9 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
                        debug("Relocating FDT to %p\n", (void *)fdt_hack);
                        memcpy(map_sysmem(fdt_hack, dt_len),
                               map_sysmem(dt_data, 0), dt_len);
-                       spl_image->fdt_addr = (void *)fdt_hack;
+                       spl_image->fdt_addr = map_sysmem(fdt_hack, 0);
                } else {
-                       spl_image->fdt_addr = (void *)dt_data;
+                       spl_image->fdt_addr = map_sysmem(dt_data, 0);
                }
        }
 

-- 
2.52.0

Reply via email to