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 <[email protected]>
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
#define BT_DRIVER_SUPPORTS_CMD 1
|
#define BT_DRIVER_SUPPORTS_CMD 1
|
||||||
#define BT_DRIVER_SUPPORTS_EVT 1
|
#define BT_DRIVER_SUPPORTS_EVT 1
|
||||||
#define BT_DRIVER_SUPPORTS_ACL 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
|
#define BT_DRIVER_SUPPORTS_ESCO 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ sched_tx_processing(bt_usb_dev* bdev)
|
|||||||
err = submit_tx_command(bdev, snbuf);
|
err = submit_tx_command(bdev, snbuf);
|
||||||
if (err != B_OK) {
|
if (err != B_OK) {
|
||||||
// re-head it
|
// 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]),
|
list_get_first_item(&bdev->nbuffersTx[BT_COMMAND]),
|
||||||
snbuf);
|
snbuf);
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ send_packet(hci_id hid, bt_packet_t type, net_buffer* nbuf)
|
|||||||
default:
|
default:
|
||||||
ERROR("%s: Unknown packet type for sending %d\n", __func__,
|
ERROR("%s: Unknown packet type for sending %d\n", __func__,
|
||||||
type);
|
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
|
// handle it with the given error
|
||||||
err = B_BAD_VALUE;
|
err = B_BAD_VALUE;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user