aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-06-07 10:28:42 -0600
committerTom Rini <trini@konsulko.com>2017-06-12 08:38:08 -0400
commit9f95267271c0b6cff64c5ac1b308e1e0281e9e3a (patch)
treef8cf335e7d18adc330bc388520c22284c492f74a /cmd
parent72c98ed1ab48dbd2f3129160413dcc10565aae0c (diff)
downloadu-boot-9f95267271c0b6cff64c5ac1b308e1e0281e9e3a.zip
u-boot-9f95267271c0b6cff64c5ac1b308e1e0281e9e3a.tar.gz
u-boot-9f95267271c0b6cff64c5ac1b308e1e0281e9e3a.tar.bz2
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 <sjg@chromium.org> Reported-by: Coverity (CID: 163248)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/fdt.c b/cmd/fdt.c
index dc00520..31a5361 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");