summaryrefslogtreecommitdiff
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2011-11-16 12:32:20 +0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-17 00:29:28 +0400
commitd1726b6dc95b5ed0914e969f6765a9e2cf7baf04 (patch)
treec0e548dc706c758f1cb2303df1588161c7c8e2b1 /net/bluetooth/l2cap_core.c
parent039d9572f11ef46ff2743798f2170a888d393ec6 (diff)
downloadlinux-d1726b6dc95b5ed0914e969f6765a9e2cf7baf04.tar.xz
Bluetooth: Refactor loop in l2cap_retransmit_one_frame
This make it easier to see what is the real reason for loop to exit. skb_queue_next return valid skb or garbage, not NULL. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index bd65b3e8a1df..26925a8f8ead 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1318,14 +1318,12 @@ static void l2cap_retransmit_one_frame(struct l2cap_chan *chan, u16 tx_seq)
if (!skb)
return;
- do {
- if (bt_cb(skb)->tx_seq == tx_seq)
- break;
-
+ while (bt_cb(skb)->tx_seq != tx_seq) {
if (skb_queue_is_last(&chan->tx_q, skb))
return;
- } while ((skb = skb_queue_next(&chan->tx_q, skb)));
+ skb = skb_queue_next(&chan->tx_q, skb);
+ }
if (chan->remote_max_tx &&
bt_cb(skb)->retries == chan->remote_max_tx) {