Skip to content

Commit debdedf

Browse files
holtmannjhedberg
authored andcommitted
Bluetooth: Fix calculation of SCO handle for packet processing
When processing SCO packets, the handle is wrongly assumed as 16-bit value. The actual size is 12-bits and the other 4-bits are used for packet flags. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent 77131df commit debdedf

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎net/bluetooth/hci_core.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4387,13 +4387,16 @@ static void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb)
43874387
{
43884388
struct hci_sco_hdr *hdr = (void *) skb->data;
43894389
struct hci_conn *conn;
4390-
__u16 handle;
4390+
__u16 handle, flags;
43914391

43924392
skb_pull(skb, HCI_SCO_HDR_SIZE);
43934393

43944394
handle = __le16_to_cpu(hdr->handle);
4395+
flags = hci_flags(handle);
4396+
handle = hci_handle(handle);
43954397

4396-
BT_DBG("%s len %d handle 0x%4.4x", hdev->name, skb->len, handle);
4398+
BT_DBG("%s len %d handle 0x%4.4x flags 0x%4.4x", hdev->name, skb->len,
4399+
handle, flags);
43974400

43984401
hdev->stat.sco_rx++;
43994402

0 commit comments

Comments
 (0)