Bluetooth: fix out of bounds access

Pointed by clang.

Change-Id: If8f60619bd98027ae7bc0e7ecaa1c86db6bacf0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2403
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
X512 2020-03-23 09:42:10 +09:00 committed by waddlesplash
parent 39a7a69b07
commit 33378c1413
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
#define BT_DRIVER_SUPPORTS_CMD 1
#define BT_DRIVER_SUPPORTS_EVT 1
#define BT_DRIVER_SUPPORTS_ACL 1
#define BT_DRIVER_SUPPORTS_SCO 0
#define BT_DRIVER_SUPPORTS_SCO 1
#define BT_DRIVER_SUPPORTS_ESCO 0

View File

@ -48,7 +48,7 @@ sched_tx_processing(bt_usb_dev* bdev)
err = submit_tx_command(bdev, snbuf);
if (err != B_OK) {
// re-head it
list_insert_item_before(&bdev->nbuffersTx[BT_COMMAND],
list_insert_item_before(&bdev->nbuffersTx[BT_COMMAND],
list_get_first_item(&bdev->nbuffersTx[BT_COMMAND]),
snbuf);
}
@ -140,7 +140,7 @@ send_packet(hci_id hid, bt_packet_t type, net_buffer* nbuf)
default:
ERROR("%s: Unknown packet type for sending %d\n", __func__,
type);
// TODO: free the net_buffer -> no, allow upper layer
// TODO: free the net_buffer -> no, allow upper layer
// handle it with the given error
err = B_BAD_VALUE;
break;