From bfa34f88f8b77596d6f70be446708a3f5a604e9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Mon, 2 Aug 2010 16:55:46 +0200 Subject: [PATCH] verify_image: print out a statement that there are no further errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It is useful to know that the printed errors are *all* the errors there were. Added missing error handling(found by inspection). Signed-off-by: Øyvind Harboe --- src/target/target.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/target/target.c b/src/target/target.c index 3bf6824be..f178ae368 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2703,7 +2703,12 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify) if (verify) { /* calculate checksum of image */ - image_calculate_checksum(buffer, buf_cnt, &checksum); + retval = image_calculate_checksum(buffer, buf_cnt, &checksum); + if (retval != ERROR_OK) + { + free(buffer); + break; + } retval = target_checksum_memory(target, image.sections[i].base_address, buf_cnt, &mem_checksum); if (retval != ERROR_OK) @@ -2769,6 +2774,10 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify) free(buffer); image_size += buf_cnt; } + if (diffs > 0) + { + command_print(CMD_CTX, "No more differences found."); + } done: if (diffs > 0) { -- 2.30.2