From 936c514bbfb975841b3199cc676c88110b19f526 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 2 Nov 2018 12:45:34 -0700 Subject: [PATCH] Fix 0.11 memory leak. (#318) Change-Id: I78dbdfc7d599b0edcfcae94070cdd7a552a1bc0c --- src/target/riscv/riscv-011.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index a77b00762..a9364d7d5 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -1664,7 +1664,7 @@ static riscv_error_t handle_halt_routine(struct target *target) break; default: LOG_ERROR("Got invalid bus access status: %d", status); - return ERROR_FAIL; + goto error; } if (data & DMCONTROL_INTERRUPT) { interrupt_set++; @@ -1794,6 +1794,8 @@ static riscv_error_t handle_halt_routine(struct target *target) } } + scans_delete(scans); + if (dbus_busy) { increase_dbus_busy_delay(target); return RE_AGAIN; @@ -1807,8 +1809,6 @@ static riscv_error_t handle_halt_routine(struct target *target) info->dpc = reg_cache_get(target, CSR_DPC); info->dcsr = reg_cache_get(target, CSR_DCSR); - scans_delete(scans); - cache_invalidate(target); return RE_OK;