Re: [PATCH] Bluetooth: i reaches pkts_to_be_removed + 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> i reaches pkts_to_be_removed + 1

> patch looks good, but can you please fill in the commit message with a
> little bit more details and background.

This was found by code inspection by the way, and not tested.

how about:
------------------------------>8-------------8<---------------------------------
When all packets are removed 'i' reaches pkts_to_be_removed + 1, so the
error message was printed upon success, and not when the last packet
wasn't removed.

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 894b2cb..177f34b 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -385,7 +385,7 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp)
 
 	spin_unlock_irqrestore(&bcsp->unack.lock, flags);
 
-	if (i != pkts_to_be_removed)
+	if (i <= pkts_to_be_removed)
 		BT_ERR("Removed only %u out of %u pkts", i, pkts_to_be_removed);
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux