starfive: avoid NULL dereference in fdt_check_header()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 28 Aug 2025 13:03:35 +0000 (15:03 +0200)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Fri, 19 Sep 2025 11:11:18 +0000 (19:11 +0800)
commit686b48af6d6f4e33f10dc707e9a8c8213b682348
tree44a5acfe5617b730c57bcf8590d68720bc0dccd8
parent409c73ef6368b07d4dbdf8391a0b9c7682dcf4b4
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 <heinrich.schuchardt@canonical.com>
Reviewed-by: E Shattow <e@freeshell.de>
board/starfive/visionfive2/spl.c