Bluetooth: Host: Unref ISO fragments after disconnection

When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.

Fix the issue by unref'ing the buffer when ISO is not in a connected
state.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
This commit is contained in:
Théo Battrel 2024-08-13 13:01:44 +02:00 committed by Fabio Baltieri
commit 3a098c9f61

View file

@ -779,6 +779,8 @@ static struct net_buf *iso_data_pull(struct bt_conn *conn,
LOG_DBG("channel has been disconnected"); LOG_DBG("channel has been disconnected");
__ASSERT_NO_MSG(b == frag); __ASSERT_NO_MSG(b == frag);
net_buf_unref(b);
/* Service other connections */ /* Service other connections */
bt_tx_irq_raise(); bt_tx_irq_raise();