diff options
Diffstat (limited to 'src/flash/flash.c')
-rw-r--r-- | src/flash/flash.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c index 7dc7f1b..03ee46f 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -574,7 +574,6 @@ int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cm { command_print(cmd_ctx, "failed writing image %s: %s", args[0], error_str); free(error_str); - free(failed); } for (i = 0; i < image.num_sections; i++) @@ -839,7 +838,7 @@ int flash_write(target_t *target, image_t *image, u32 *written, char **error_str size_read = image->sections[section].size - section_offset; if ((retval = image_read_section(image, section, section_offset, - size_read, buffer + buffer_size, &size_read)) != ERROR_OK || size_read == 0) + run_size, buffer + buffer_size, &size_read)) != ERROR_OK || size_read == 0) { free(buffer); @@ -868,7 +867,7 @@ int flash_write(target_t *target, image_t *image, u32 *written, char **error_str } retval = ERROR_OK; -
+ if (erase) { /* calculate and erase sectors */ |