Bluetooth: L2CAP: Fix not canceling RTX work

If the channel is being destroyed the RTX work should be cancelled as
it may cause destroy to be called again.

Change-Id: I49c10d64a2108719d28e456fb5b4bfb50ef8a140
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-07-11 13:41:21 +03:00 committed by Johan Hedberg
commit d98068be94

View file

@ -491,6 +491,9 @@ static void l2cap_chan_destroy(struct bt_l2cap_chan *chan)
BT_DBG("chan %p cid 0x%04x", chan->conn, ch, ch->rx.cid);
/* Cancel ongoing work */
nano_delayed_work_cancel(&ch->rtx_work);
/* There could be a writer waiting for credits so return a dummy credit
* to wake it up.
*/