Message ID | 20170607162847.16971-5-sjg@chromium.org |
---|---|
State | Accepted |
Commit | 72c98ed1ab48dbd2f3129160413dcc10565aae0c |
Delegated to: | Tom Rini |
Headers | show |
On Wed, Jun 07, 2017 at 10:28:41AM -0600, Simon Glass wrote: > 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: 163249) > Fixes: bc80295b (fdt: Add get commands to fdt) Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/cmd/fdt.c b/cmd/fdt.c index a21415dab4..3e889fc3bb 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -371,7 +371,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* no property value */ setenv(var, ""); return 0; - } else if (len > 0) { + } else if (nodep && len > 0) { if (subcmd[0] == 'v') { int ret;
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: 163249) Fixes: bc80295b (fdt: Add get commands to fdt) --- cmd/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)