From 6ec5fe8269fc1b28531c734071f8dd5abf984b46 Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Sun, 5 Aug 2018 16:39:31 +0200 Subject: [PATCH] flash/at91sam4: fix clang static analyzer warning Change-Id: I5e5319d855c868adfa012f68086f7f809ec5a069 Signed-off-by: Tomas Vanek Reviewed-on: http://openocd.zylin.com/4639 Tested-by: jenkins --- src/flash/nor/at91sam4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c index 577360a6..2eec15e2 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); -- 2.39.5