public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Do not purge queue in Basic Mode
@ 2012-05-18 22:03 Gustavo Padovan
  2012-05-18 22:09 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Padovan @ 2012-05-18 22:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

chan->tx_q is only initialized if we use ERTM or Streaming mode.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 net/bluetooth/l2cap_core.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index b70dca4..ccd2d85 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -549,6 +549,9 @@ static void l2cap_chan_del(struct l2cap_chan *chan, int err)
 	if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state))
 		return;
 
+	if (chan->mode == L2CAP_MODE_BASIC)
+		return;
+
 	skb_queue_purge(&chan->tx_q);
 
 	if (chan->mode == L2CAP_MODE_ERTM) {
-- 
1.7.10.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Do not purge queue in Basic Mode
  2012-05-18 22:03 [PATCH] Bluetooth: Do not purge queue in Basic Mode Gustavo Padovan
@ 2012-05-18 22:09 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2012-05-18 22:09 UTC (permalink / raw)
  To: Gustavo Padovan; +Cc: linux-bluetooth, Gustavo Padovan

Hi Gustavo,

> chan->tx_q is only initialized if we use ERTM or Streaming mode.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  net/bluetooth/l2cap_core.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index b70dca4..ccd2d85 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -549,6 +549,9 @@ static void l2cap_chan_del(struct l2cap_chan *chan, int err)
>  	if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state))
>  		return;
>  
> +	if (chan->mode == L2CAP_MODE_BASIC)
> +		return;
> +
>  	skb_queue_purge(&chan->tx_q);
>  
>  	if (chan->mode == L2CAP_MODE_ERTM) {

please turn this into a switch statement. No point in checking
chan->mode twice.

Regards

Marcel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-18 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 22:03 [PATCH] Bluetooth: Do not purge queue in Basic Mode Gustavo Padovan
2012-05-18 22:09 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox