diff options
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/hci_bcsp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 4d37bb312ee3..7938062c1cc7 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c | |||
@@ -352,14 +352,14 @@ static int bcsp_flush(struct hci_uart *hu) | |||
352 | /* Remove ack'ed packets */ | 352 | /* Remove ack'ed packets */ |
353 | static void bcsp_pkt_cull(struct bcsp_struct *bcsp) | 353 | static void bcsp_pkt_cull(struct bcsp_struct *bcsp) |
354 | { | 354 | { |
355 | struct sk_buff *skb, *tmp; | ||
355 | unsigned long flags; | 356 | unsigned long flags; |
356 | struct sk_buff *skb; | ||
357 | int i, pkts_to_be_removed; | 357 | int i, pkts_to_be_removed; |
358 | u8 seqno; | 358 | u8 seqno; |
359 | 359 | ||
360 | spin_lock_irqsave(&bcsp->unack.lock, flags); | 360 | spin_lock_irqsave(&bcsp->unack.lock, flags); |
361 | 361 | ||
362 | pkts_to_be_removed = bcsp->unack.qlen; | 362 | pkts_to_be_removed = skb_queue_len(&bcsp->unack); |
363 | seqno = bcsp->msgq_txseq; | 363 | seqno = bcsp->msgq_txseq; |
364 | 364 | ||
365 | while (pkts_to_be_removed) { | 365 | while (pkts_to_be_removed) { |
@@ -373,19 +373,19 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp) | |||
373 | BT_ERR("Peer acked invalid packet"); | 373 | BT_ERR("Peer acked invalid packet"); |
374 | 374 | ||
375 | BT_DBG("Removing %u pkts out of %u, up to seqno %u", | 375 | BT_DBG("Removing %u pkts out of %u, up to seqno %u", |
376 | pkts_to_be_removed, bcsp->unack.qlen, (seqno - 1) & 0x07); | 376 | pkts_to_be_removed, skb_queue_len(&bcsp->unack), |
377 | (seqno - 1) & 0x07); | ||
377 | 378 | ||
378 | for (i = 0, skb = ((struct sk_buff *) &bcsp->unack)->next; i < pkts_to_be_removed | 379 | i = 0; |
379 | && skb != (struct sk_buff *) &bcsp->unack; i++) { | 380 | skb_queue_walk_safe(&bcsp->unack, skb, tmp) { |
380 | struct sk_buff *nskb; | 381 | if (i++ >= pkts_to_be_removed) |
382 | break; | ||
381 | 383 | ||
382 | nskb = skb->next; | ||
383 | __skb_unlink(skb, &bcsp->unack); | 384 | __skb_unlink(skb, &bcsp->unack); |
384 | kfree_skb(skb); | 385 | kfree_skb(skb); |
385 | skb = nskb; | ||
386 | } | 386 | } |
387 | 387 | ||
388 | if (bcsp->unack.qlen == 0) | 388 | if (skb_queue_empty(&bcsp->unack)) |
389 | del_timer(&bcsp->tbcsp); | 389 | del_timer(&bcsp->tbcsp); |
390 | 390 | ||
391 | spin_unlock_irqrestore(&bcsp->unack.lock, flags); | 391 | spin_unlock_irqrestore(&bcsp->unack.lock, flags); |