Bluetooth: hci_event: Detect if HCI_EV_NUM_COMP_PKTS is unbalanced
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 20 Aug 2025 21:04:00 +0000 (17:04 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 22 Aug 2025 17:56:57 +0000 (13:56 -0400)
commit15bf2c6391bafb14a3020d06ec0761bce0803463
treed9512b4a8057fb96dc44a1c011132871fbacdebc
parentb7fafbc499b5ee164018eb0eefe9027f5a6aaad2
Bluetooth: hci_event: Detect if HCI_EV_NUM_COMP_PKTS is unbalanced

This attempts to detect if HCI_EV_NUM_COMP_PKTS contain an unbalanced
(more than currently considered outstanding) number of packets otherwise
it could cause the hcon->sent to underflow and loop around breaking the
tracking of the outstanding packets pending acknowledgment.

Fixes: f42809185896 ("Bluetooth: Simplify num_comp_pkts_evt function")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c