Commit 2ee47b22 authored by Antonio Borneo's avatar Antonio Borneo Committed by Øyvind Harboe
Browse files

TARGET: fix segfault in handle_dump_image_command()



The struct fileio is used after fileio_close().
Move fileio_close() after last usage.
Signed-off-by: default avatarAntonio Borneo <borneo.antonio@gmail.com>
parent e3773e3e
......@@ -2643,9 +2643,6 @@ COMMAND_HANDLER(handle_dump_image_command)
address += this_run_size;
}
if ((retvaltemp = fileio_close(&fileio)) != ERROR_OK)
return retvaltemp;
if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK))
{
int filesize;
......@@ -2657,6 +2654,9 @@ COMMAND_HANDLER(handle_dump_image_command)
duration_elapsed(&bench), duration_kbps(&bench, filesize));
}
if ((retvaltemp = fileio_close(&fileio)) != ERROR_OK)
return retvaltemp;
return retval;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment