[PATCH v3] fdt_region: Check return value of fdt_get_property_by_offset() calls

Simon Glass sjg at chromium.org
Sat May 30 01:03:03 CEST 2026


On 2026-05-27T11:24:43, Anton Ivanov <anton at binarly.io> wrote:
> fdt_region: Check return value of fdt_get_property_by_offset() calls
>
> fdt_get_property_by_offset() returns NULL for FDT with version
> less than 0x10. Callers in fdt_find_regions(),
> fdt_add_alias_regions(), and fdt_next_region() dereference the
> result without checking, leading to a NULL pointer dereference.
>
> Add NULL checks before accessing the returned property pointer.
> Also add a missing NULL check for fdt_string() in
> fdt_add_alias_regions() and fdt_next_region().
>
> Signed-off-by: Anton Ivanov <anton at binarly.io>
>
> boot/fdt_region.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list