aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-05-18 20:22:38 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-05 06:34:05 +0300
commitee556f662ca9e96a3cdb0d10745f9fd0cbf549af (patch)
tree6e704c6181281e75ea1b083674b44ef1003371bf /net/bluetooth/l2cap_core.c
parentBluetooth: Enable ERTM by default (diff)
downloadlinux-dev-ee556f662ca9e96a3cdb0d10745f9fd0cbf549af.tar.xz
linux-dev-ee556f662ca9e96a3cdb0d10745f9fd0cbf549af.zip
Bluetooth: Do not purge queue in Basic Mode
chan->tx_q is only initialized if we use ERTM or Streaming mode. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index b70dca4472a7..ae69da8d01e7 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -549,9 +549,11 @@ static void l2cap_chan_del(struct l2cap_chan *chan, int err)
if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state))
return;
- skb_queue_purge(&chan->tx_q);
+ switch(chan->mode) {
+ case L2CAP_MODE_BASIC:
+ break;
- if (chan->mode == L2CAP_MODE_ERTM) {
+ case L2CAP_MODE_ERTM:
__clear_retrans_timer(chan);
__clear_monitor_timer(chan);
__clear_ack_timer(chan);
@@ -560,7 +562,15 @@ static void l2cap_chan_del(struct l2cap_chan *chan, int err)
l2cap_seq_list_free(&chan->srej_list);
l2cap_seq_list_free(&chan->retrans_list);
+
+ /* fall through */
+
+ case L2CAP_MODE_STREAMING:
+ skb_queue_purge(&chan->tx_q);
+ break;
}
+
+ return;
}
static void l2cap_chan_cleanup_listen(struct sock *parent)