We know that fdt_getprop() does not return NULL when len is > 0 but
coverity does not. Add an extra check to keep it happy.

Signed-off-by: Simon Glass <s...@chromium.org>
Reported-by: Coverity (CID: 163248)
---

 cmd/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/fdt.c b/cmd/fdt.c
index 3e889fc3bb..5d80eb2d00 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -962,7 +962,7 @@ static int fdt_print(const char *pathp, char *prop, int 
depth)
                        /* no property value */
                        printf("%s %s\n", pathp, prop);
                        return 0;
-               } else if (len > 0) {
+               } else if (nodep && len > 0) {
                        printf("%s = ", prop);
                        print_data (nodep, len);
                        printf("\n");
-- 
2.13.0.506.g27d5fe0cd-goog

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to