From: Simon Glass Date: Wed, 7 Jun 2017 16:28:42 +0000 (-0600) Subject: fdt: Add a check to fdt_print() for coverity X-Git-Url: http://git.dujemihanovic.xyz/%22/img/sics.gif/%22/static/git-favicon.png?a=commitdiff_plain;h=9f95267271c0b6cff64c5ac1b308e1e0281e9e3a;p=u-boot.git fdt: Add a check to fdt_print() for coverity 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 Reported-by: Coverity (CID: 163248) --- diff --git a/cmd/fdt.c b/cmd/fdt.c index dc0052040a..31a536198c 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -975,7 +975,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");