diff options
author | Anantha Idapalapati <aidapalapati@nvidia.com> | 2010-04-13 16:57:33 +0530 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-04-13 15:57:43 -0700 |
commit | 283cec48bd3f48c988c61a460f4f2e125e18e80a (patch) | |
tree | 897b16d0f4302bfecd2082671c3766a96bfcdeae | |
parent | c31c451d72bc2c6e3973adf4d3356a872cc77539 (diff) |
bcsp: Fix BCSP Bug: bcsp_pkt_cull: Removed only x out of x-1 pkts errors.
After debugging this issue - I found that the issue was fixed in
linux-2.6.32. back porting the fix to present kernel.
The routine bcsp_pkt_cull() displays the false error message
"Removed only %u out of %u pkts" when multiple to be acked
packets are queued.
As if (i++ >= pkts_to_be_removed)
break;
will breaks the loop and increase the counter i
when i==pkts_to_be_removed, 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 display the false message.
The counter i must not increase on the same line.
Change-Id: I0ca08003a4ec7d1b8ed105f219964934afad1a50
Reviewed-on: http://git-master/r/1098
Reviewed-by: Udaykumar Rameshchan Raval <uraval@nvidia.com>
Tested-by: Udaykumar Rameshchan Raval <uraval@nvidia.com>
Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r-- | drivers/bluetooth/hci_bcsp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index 894b2cb11ea6..ee977493c15b 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c @@ -373,9 +373,11 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp) i = 0; skb_queue_walk_safe(&bcsp->unack, skb, tmp) { - if (i++ >= pkts_to_be_removed) + if (i >= pkts_to_be_removed) break; + i++; + __skb_unlink(skb, &bcsp->unack); kfree_skb(skb); } |