summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jtag/core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index a8d65f1e..aaa7da1f 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -282,8 +282,12 @@ int jtag_call_event_callbacks(enum jtag_event event)
while (callback)
{
+ jtag_event_callback_t *next;
+
+ /* callback may remove itself */
+ next = callback->next;
callback->callback(event, callback->priv);
- callback = callback->next;
+ callback = next;
}
return ERROR_OK;