From: Øyvind Harboe Date: Mon, 14 Jun 2010 07:30:37 +0000 (+0200) Subject: target: fix retval gaffe in mwX commands X-Git-Tag: v0.5.0-rc1~639 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aa2de47d3ce4d484c124f0449702f511aab49112;p=openocd target: fix retval gaffe in mwX commands 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 --- 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;