diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-18 19:22:38 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:05 -0400 |
commit | ee556f662ca9e96a3cdb0d10745f9fd0cbf549af (patch) | |
tree | 6e704c6181281e75ea1b083674b44ef1003371bf | |
parent | d1de6d46dc7b503d77ec59c849acacadfece1da1 (diff) |
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>
-rw-r--r-- | net/bluetooth/l2cap_core.c | 14 |
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) | |||
549 | if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state)) | 549 | if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state)) |
550 | return; | 550 | return; |
551 | 551 | ||
552 | skb_queue_purge(&chan->tx_q); | 552 | switch(chan->mode) { |
553 | case L2CAP_MODE_BASIC: | ||
554 | break; | ||
553 | 555 | ||
554 | if (chan->mode == L2CAP_MODE_ERTM) { | 556 | case L2CAP_MODE_ERTM: |
555 | __clear_retrans_timer(chan); | 557 | __clear_retrans_timer(chan); |
556 | __clear_monitor_timer(chan); | 558 | __clear_monitor_timer(chan); |
557 | __clear_ack_timer(chan); | 559 | __clear_ack_timer(chan); |
@@ -560,7 +562,15 @@ static void l2cap_chan_del(struct l2cap_chan *chan, int err) | |||
560 | 562 | ||
561 | l2cap_seq_list_free(&chan->srej_list); | 563 | l2cap_seq_list_free(&chan->srej_list); |
562 | l2cap_seq_list_free(&chan->retrans_list); | 564 | l2cap_seq_list_free(&chan->retrans_list); |
565 | |||
566 | /* fall through */ | ||
567 | |||
568 | case L2CAP_MODE_STREAMING: | ||
569 | skb_queue_purge(&chan->tx_q); | ||
570 | break; | ||
563 | } | 571 | } |
572 | |||
573 | return; | ||
564 | } | 574 | } |
565 | 575 | ||
566 | static void l2cap_chan_cleanup_listen(struct sock *parent) | 576 | static void l2cap_chan_cleanup_listen(struct sock *parent) |