src/flash/nor/at91sam3|4l|7: fix clang static analyzer warnings
[fw/openocd] / src / flash / nor / at91sam3.c
index 2457c15f369da5d43ff66c3eb21e71e16889bae7..af0b50b49a35703e42abd1cfb466035e73b3acc9 100644 (file)
@@ -3653,7 +3653,8 @@ showall:
                }
                if ((who >= 0) && (((unsigned)(who)) < pChip->details.n_gpnvms)) {
                        r = FLASHD_GetGPNVM(&(pChip->details.bank[0]), who, &v);
-                       command_print(CMD, "sam3-gpnvm%u: %u", who, v);
+                       if (r == ERROR_OK)
+                               command_print(CMD, "sam3-gpnvm%u: %u", who, v);
                        return r;
                } else {
                        command_print(CMD, "sam3-gpnvm invalid GPNVM: %u", who);