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>
This commit is contained in:
parent
039d9572f1
commit
d1726b6dc9
|
@ -1318,14 +1318,12 @@ static void l2cap_retransmit_one_frame(struct l2cap_chan *chan, u16 tx_seq)
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
do {
|
while (bt_cb(skb)->tx_seq != tx_seq) {
|
||||||
if (bt_cb(skb)->tx_seq == tx_seq)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (skb_queue_is_last(&chan->tx_q, skb))
|
if (skb_queue_is_last(&chan->tx_q, skb))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} while ((skb = skb_queue_next(&chan->tx_q, skb)));
|
skb = skb_queue_next(&chan->tx_q, skb);
|
||||||
|
}
|
||||||
|
|
||||||
if (chan->remote_max_tx &&
|
if (chan->remote_max_tx &&
|
||||||
bt_cb(skb)->retries == chan->remote_max_tx) {
|
bt_cb(skb)->retries == chan->remote_max_tx) {
|
||||||
|
|
Loading…
Reference in New Issue