aboutsummaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2018-08-05 16:39:31 +0200
committerTomas Vanek <vanekt@fbl.cz>2018-08-21 19:26:14 +0100
commit6ec5fe8269fc1b28531c734071f8dd5abf984b46 (patch)
tree1003ff091ed1d1fac2e38139e6f276b0101c84bd /src/flash
parentd78cf6f3126b0c28321d36614e184912dfc0c609 (diff)
downloadriscv-openocd-6ec5fe8269fc1b28531c734071f8dd5abf984b46.zip
riscv-openocd-6ec5fe8269fc1b28531c734071f8dd5abf984b46.tar.gz
riscv-openocd-6ec5fe8269fc1b28531c734071f8dd5abf984b46.tar.bz2
flash/at91sam4: fix clang static analyzer warning
Change-Id: I5e5319d855c868adfa012f68086f7f809ec5a069 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4639 Tested-by: jenkins
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/nor/at91sam4.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c
index 577360a..2eec15e 100644
--- a/src/flash/nor/at91sam4.c
+++ b/src/flash/nor/at91sam4.c
@@ -3131,7 +3131,8 @@ showall:
}
if ((who >= 0) && (((unsigned)(who)) < pChip->details.n_gpnvms)) {
r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), who, &v);
- command_print(CMD_CTX, "sam4-gpnvm%u: %u", who, v);
+ if (r == ERROR_OK)
+ command_print(CMD_CTX, "sam4-gpnvm%u: %u", who, v);
return r;
} else {
command_print(CMD_CTX, "sam4-gpnvm invalid GPNVM: %u", who);