1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

can/isotp: remove timers when closing connection

Timers were not properly removed leading to hard faults if it fires
after the connection is closed.
This commit is contained in:
Vincent Dupont 2019-08-06 16:18:32 +02:00
parent d6356bdc08
commit 32b00706e3

View File

@ -878,6 +878,7 @@ int isotp_release(struct isotp *isotp)
.can_mask = 0xFFFFFFFF,
};
raw_can_unsubscribe_rx(isotp->entry.ifnum, &filter, isotp_pid, isotp);
xtimer_remove(&isotp->rx_timer);
if (isotp->rx.snip) {
DEBUG("isotp_release: freeing rx buf\n");
@ -887,6 +888,8 @@ int isotp_release(struct isotp *isotp)
isotp->rx.state = ISOTP_IDLE;
isotp->entry.target.pid = KERNEL_PID_UNDEF;
xtimer_remove(&isotp->tx_timer);
mutex_lock(&lock);
LL_DELETE(isotp_list, isotp);
mutex_unlock(&lock);