mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Add protection for rfcomm close API in SPP
This commit is contained in:
parent
f38d93f73c
commit
f97188d2d3
@ -210,16 +210,18 @@ void port_release_port (tPORT *p_port)
|
||||
|
||||
osi_mutex_global_lock();
|
||||
RFCOMM_TRACE_DEBUG("port_release_port, p_port:%p", p_port);
|
||||
while ((p_buf = (BT_HDR *)fixed_queue_dequeue(p_port->rx.queue, 0)) != NULL) {
|
||||
osi_free (p_buf);
|
||||
if (p_port->rx.queue) {
|
||||
while ((p_buf = (BT_HDR *)fixed_queue_dequeue(p_port->rx.queue, 0)) != NULL) {
|
||||
osi_free (p_buf);
|
||||
}
|
||||
}
|
||||
|
||||
p_port->rx.queue_size = 0;
|
||||
|
||||
while ((p_buf = (BT_HDR *)fixed_queue_dequeue(p_port->tx.queue, 0)) != NULL) {
|
||||
osi_free (p_buf);
|
||||
if (p_port->tx.queue) {
|
||||
while ((p_buf = (BT_HDR *)fixed_queue_dequeue(p_port->tx.queue, 0)) != NULL) {
|
||||
osi_free (p_buf);
|
||||
}
|
||||
}
|
||||
|
||||
p_port->tx.queue_size = 0;
|
||||
|
||||
osi_mutex_global_unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user