]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
do not pass NULL pointer to libfdt
authorStanislav Pinchuk <Stanislav.Pinchuk@kaspersky.com>
Wed, 20 Jan 2021 18:52:23 +0000 (21:52 +0300)
committerSimon Glass <sjg@chromium.org>
Sat, 30 Jan 2021 21:25:42 +0000 (14:25 -0700)
Re-send because of line-wraps.

Without this patch, u-boot just hangs if the fdt pointer is
not initialized. The diagnostic subsystems are not yet initialized,
so all you get is a blind hang.

Signed-off-by: Stanislav.Pinchuk@kaspersky.com
include/dm/read.h

index f6f8b875d1c278810c3fadbf2d2d93ed7584c346..03ba98232a610ea2c9be98878cb0b1849c69cb3b 100644 (file)
@@ -1006,7 +1006,7 @@ static inline u64 dev_translate_dma_address(const struct udevice *dev,
 
 static inline int dev_read_alias_highest_id(const char *stem)
 {
-       if (!CONFIG_IS_ENABLED(OF_LIBFDT))
+       if (!CONFIG_IS_ENABLED(OF_LIBFDT) || !gd->fdt_blob)
                return -1;
        return fdtdec_get_alias_highest_id(gd->fdt_blob, stem);
 }