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 <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe 2010-06-14 09:30:37 +02:00
parent bac52fbac8
commit aa2de47d3c

View File

@ -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;