diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-10-18 11:46:06 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-10-21 07:47:31 +0300 |
commit | db45a1b8b91bc7e6c29a7d9a242777a38aa3f067 (patch) | |
tree | 14f472b7d93fb285a4198dc8e0b0ab338117ab30 /net | |
parent | 970f07e612ada4a5ee8b5b10d0e12acc4ee73adb (diff) |
Bluetooth: L2CAP: Drop extra reference to fragments
net_buf_frag_add already adds a reference to the fragment.
Change-Id: I28c6bde862c09d1dea0182bc0d08bfc1f4565d06
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 778c08ae1..c504011ab 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -990,7 +990,6 @@ static struct net_buf *l2cap_alloc_frag(struct bt_l2cap_le_chan *chan) { struct net_buf *frag = NULL; - frag = chan->chan.ops->alloc_buf(&chan->chan); if (!frag) { return NULL; @@ -1000,6 +999,9 @@ static struct net_buf *l2cap_alloc_frag(struct bt_l2cap_le_chan *chan) net_buf_frag_add(chan->_sdu, frag); + /* Drop own reference since net_buf_frag_add adds a reference */ + net_buf_unref(frag); + return frag; } |