From: Heinrich Schuchardt Date: Thu, 28 Aug 2025 13:03:35 +0000 (+0200) Subject: starfive: avoid NULL dereference in fdt_check_header() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=686b48af6d6f4e33f10dc707e9a8c8213b682348;p=thirdparty%2Fu-boot.git starfive: avoid NULL dereference in fdt_check_header() If the u-boot.itb read from SD-card is invalid, fdt_check_header() may be called with a NULL pointer. This was observed on an StarFive VisionFive Lite when trying to revover the board via UART. Add a missing check in the starfive board code. Signed-off-by: Heinrich Schuchardt Reviewed-by: E Shattow --- diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c index 3dfa931b655..fe14b44ce28 100644 --- a/board/starfive/visionfive2/spl.c +++ b/board/starfive/visionfive2/spl.c @@ -23,7 +23,8 @@ DECLARE_GLOBAL_DATA_PTR; void spl_perform_fixups(struct spl_image_info *spl_image) { /* Update the memory size which read from eeprom or DT */ - fdt_fixup_memory(spl_image->fdt_addr, 0x40000000, gd->ram_size); + if (spl_image->fdt_addr) + fdt_fixup_memory(spl_image->fdt_addr, 0x40000000, gd->ram_size); } static void jh7110_jtag_init(void)