From aa2de47d3ce4d484c124f0449702f511aab49112 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Mon, 14 Jun 2010 09:30:37 +0200 Subject: [PATCH] target: fix retval gaffe in mwX commands MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit failure to write to memory was not propagated. This is an interesting case of broken error handling: with exceptions we wouldn't have had this at all, and I also wonder if there is a GCC option to warn about these kinds of potential bugs. Signed-off-by: Øyvind Harboe --- src/target/target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/target.c b/src/target/target.c index 01d94416..435d7b66 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2378,7 +2378,7 @@ static int target_fill_mem(struct target *target, { current = chunk_size; } - int retval = fn(target, address + x * data_size, data_size, current, target_buf); + retval = fn(target, address + x * data_size, data_size, current, target_buf); if (retval != ERROR_OK) { break; -- 2.39.5