Re: [PATCH v1] bluetooth: guard against controllers sending zero'd events

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

 



Hi Marcel,

On 29. Feb 2020, at 9.14, Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote:
>> --- a/net/bluetooth/hci_event.c
>> +++ b/net/bluetooth/hci_event.c
>> @@ -5868,7 +5868,8 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
>> 	u8 status = 0, event = hdr->evt, req_evt = 0;
>> 	u16 opcode = HCI_OP_NOP;
>> 
>> -	if (hdev->sent_cmd && bt_cb(hdev->sent_cmd)->hci.req_event == event) {
>> +	if (hdev->sent_cmd && event &&
>> +	    bt_cb(hdev->sent_cmd)->hci.req_event == event) {
> 
> Why are you bothering to check for event here. Do we have requests set with hci_req.event == 0?

If I remember right, most requests are like that. req.event is only used then the request completes in something else than a command complete/status.

Johan



[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