Skip to content

Commit 444c6dd

Browse files
Johan Hedbergholtmann
authored andcommitted
Bluetooth: Add clarifying comment to command status handling
When dealing with HCI command status events, the reasoning for trying to mark a request as complete if no specific event is being waited for and status was success is not self-evident. This patch adds a clarifying comment above the if-statement. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 64dd374 commit 444c6dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/bluetooth/hci_event.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,6 +3124,12 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
31243124
if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags))
31253125
atomic_set(&hdev->cmd_cnt, 1);
31263126

3127+
/* Indicate request completion if the command failed. Also, if
3128+
* we're not waiting for a special event and we get a success
3129+
* command status we should try to flag the request as completed
3130+
* (since for this kind of commands there will not be a command
3131+
* complete event).
3132+
*/
31273133
if (ev->status ||
31283134
(hdev->sent_cmd && !bt_cb(hdev->sent_cmd)->req.event))
31293135
hci_req_cmd_complete(hdev, opcode, ev->status);

0 commit comments

Comments
 (0)