diff options
author | DmitryShpak <disona@yandex.ru> | 2015-03-25 14:31:16 +0300 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2015-04-02 00:18:25 +0100 |
commit | d3c2679bcb8e8ba25e7b6e443b39f57474afc099 (patch) | |
tree | 27fb37f78c3d8221756f194a4faad80c34c7d8da | |
parent | 09ca5af4d01e00ccec4fa7ff5b3281cae26ed375 (diff) | |
download | riscv-openocd-d3c2679bcb8e8ba25e7b6e443b39f57474afc099.zip riscv-openocd-d3c2679bcb8e8ba25e7b6e443b39f57474afc099.tar.gz riscv-openocd-d3c2679bcb8e8ba25e7b6e443b39f57474afc099.tar.bz2 |
target/target.c: fixed rp check bug in asynchronous flash write algorithm.
Bug in read pointer check within flash write algorithm made incorrect check
if block size is more than 4 bytes (bug was detected with 16 bytes block size).
Change-Id: I5b8e7ebca619a0a85ae6e9e496ff792248134d81
Signed-off-by: DmitryShpak <disona@yandex.ru>
Reviewed-on: http://openocd.zylin.com/2657
Tested-by: jenkins
Reviewed-by: Jens Bauer <jens@gpio.dk>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
-rw-r--r-- | src/target/target.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/target.c b/src/target/target.c index a8d3cba..8a7547b 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -938,7 +938,7 @@ int target_run_flash_async_algorithm(struct target *target, break; } - if ((rp & (block_size - 1)) || rp < fifo_start_addr || rp >= fifo_end_addr) { + if (((rp - fifo_start_addr) & (block_size - 1)) || rp < fifo_start_addr || rp >= fifo_end_addr) { LOG_ERROR("corrupted fifo read pointer 0x%" PRIx32, rp); break; } |