Skip to content

Commit 936c514

Browse files
authored
Fix 0.11 memory leak. (#318)
Change-Id: I78dbdfc7d599b0edcfcae94070cdd7a552a1bc0c
1 parent dc4fe85 commit 936c514

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/target/riscv/riscv-011.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ static riscv_error_t handle_halt_routine(struct target *target)
16641664
break;
16651665
default:
16661666
LOG_ERROR("Got invalid bus access status: %d", status);
1667-
return ERROR_FAIL;
1667+
goto error;
16681668
}
16691669
if (data & DMCONTROL_INTERRUPT) {
16701670
interrupt_set++;
@@ -1794,6 +1794,8 @@ static riscv_error_t handle_halt_routine(struct target *target)
17941794
}
17951795
}
17961796

1797+
scans_delete(scans);
1798+
17971799
if (dbus_busy) {
17981800
increase_dbus_busy_delay(target);
17991801
return RE_AGAIN;
@@ -1807,8 +1809,6 @@ static riscv_error_t handle_halt_routine(struct target *target)
18071809
info->dpc = reg_cache_get(target, CSR_DPC);
18081810
info->dcsr = reg_cache_get(target, CSR_DCSR);
18091811

1810-
scans_delete(scans);
1811-
18121812
cache_invalidate(target);
18131813

18141814
return RE_OK;

0 commit comments

Comments
 (0)