aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2012-09-30 23:03:44 +0200
committerSpencer Oliver <spen@spen-soft.co.uk>2012-10-08 10:25:50 +0000
commit8415353f2b15af52363ce88df0b16f8b857d7967 (patch)
treee61c11f8864f727cde6b2f165db9bce59d842f2f
parent4da4e1cfb7d93dcedc333c11c787b83b8baf7dfa (diff)
downloadriscv-openocd-8415353f2b15af52363ce88df0b16f8b857d7967.zip
riscv-openocd-8415353f2b15af52363ce88df0b16f8b857d7967.tar.gz
riscv-openocd-8415353f2b15af52363ce88df0b16f8b857d7967.tar.bz2
flash/nor/stellaris: Remove unnecessary write_algorithm check
The pointer must be non-null here since we returned if allocation failed. Change-Id: I9b75099ed3b3870c815d1df5760ed1f3fe1d20d6 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/866 Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
-rw-r--r--src/flash/nor/stellaris.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/flash/nor/stellaris.c b/src/flash/nor/stellaris.c
index 0bb9369..6721395 100644
--- a/src/flash/nor/stellaris.c
+++ b/src/flash/nor/stellaris.c
@@ -1031,8 +1031,7 @@ static int stellaris_write_block(struct flash_bank *bank,
while (target_alloc_working_area_try(target, buffer_size, &source) != ERROR_OK) {
buffer_size /= 2;
if (buffer_size <= buf_min) {
- if (write_algorithm)
- target_free_working_area(target, write_algorithm);
+ target_free_working_area(target, write_algorithm);
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
}
LOG_DEBUG("retry target_alloc_working_area(%s, size=%u)",