net: bt: Fix leaking TX packets
Bluetooth only cares about the actual payload so net_pkt can be unref as soon as the data fragments are detached. Jira: ZEP-2070 Change-Id: Id528d5440f42903378883f5e696b3f663bbfa313 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
efc3ba6b98
commit
86a72e1ed4
1 changed files with 8 additions and 1 deletions
|
@ -225,11 +225,18 @@ static struct bt_context bt_context_data = {
|
|||
static int bt_iface_send(struct net_if *iface, struct net_pkt *pkt)
|
||||
{
|
||||
struct bt_context *ctxt = net_if_get_device(iface)->driver_data;
|
||||
struct net_buf *frags;
|
||||
int ret;
|
||||
|
||||
NET_DBG("iface %p pkt %p len %zu", iface, pkt, net_pkt_get_len(pkt));
|
||||
|
||||
ret = bt_l2cap_chan_send(&ctxt->ipsp_chan.chan, pkt->frags);
|
||||
/* Dettach data fragments for packet */
|
||||
frags = pkt->frags;
|
||||
pkt->frags = NULL;
|
||||
|
||||
net_pkt_unref(pkt);
|
||||
|
||||
ret = bt_l2cap_chan_send(&ctxt->ipsp_chan.chan, frags);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue