Bluetooth: L2CAP: Fix not unrefing tx_buf
If the channel has a tx_buf it must be unrefed when destroying the channel. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
105e0997f2
commit
3f43413887
1 changed files with 5 additions and 0 deletions
|
@ -751,6 +751,11 @@ static void l2cap_chan_destroy(struct bt_l2cap_chan *chan)
|
|||
/* Cancel ongoing work */
|
||||
k_delayed_work_cancel(&chan->rtx_work);
|
||||
|
||||
if (ch->tx_buf) {
|
||||
net_buf_unref(ch->tx_buf);
|
||||
ch->tx_buf = NULL;
|
||||
}
|
||||
|
||||
/* Remove buffers on the TX queue */
|
||||
while ((buf = net_buf_get(&ch->tx_queue, K_NO_WAIT))) {
|
||||
net_buf_unref(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue