aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorWending Weng <wweng@rheinmetall.ca>2009-08-24 16:05:17 -0400
committerMarcel Holtmann <marcel@holtmann.org>2009-08-24 16:32:32 -0400
commitd2e353f7c3c5fbb3add0341c10ae167ee745d23b (patch)
treecf84f27d7de17e941b8c1bd60b428389201aa712 /drivers/bluetooth
parent1b7bf4edca0fdbad70c44e139f4cfebd6759de81 (diff)
Bluetooth: Fix false errors from bcsp_pkt_cull function
The error message "Removed only %u out of %u pkts" is printed when multiple to be acked packets are queued. if (i++ >= pkts_to_be_removed) break; This will break out of the loop and increase the counter i when i==pkts_to_be_removed and the loop ends up with i=pkts_to_be_removed+1. The following line if (i != pkts_to_be_removed) { BT_ERR("Removed only %u out of %u pkts", i, pkts_to_be_removed); } will then display the false message. The counter i must not increase on the same statement. Signed-off-by: Wending Weng <wweng@rheinmetall.ca> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_bcsp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 894b2cb11ea6..40aec0fb8596 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -373,8 +373,9 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp)
373 373
374 i = 0; 374 i = 0;
375 skb_queue_walk_safe(&bcsp->unack, skb, tmp) { 375 skb_queue_walk_safe(&bcsp->unack, skb, tmp) {
376 if (i++ >= pkts_to_be_removed) 376 if (i >= pkts_to_be_removed)
377 break; 377 break;
378 i++;
378 379
379 __skb_unlink(skb, &bcsp->unack); 380 __skb_unlink(skb, &bcsp->unack);
380 kfree_skb(skb); 381 kfree_skb(skb);