Skip to content

Commit 4a9bceb

Browse files
Bhasker NetiShruthi Krishna
authored andcommitted
Bluetooth : Ignore incomming events when the hci device is down
In error conditions Adapter state machine via Bluez tries to reset the hci device, during that in some rare scenario if some pending event comes from riva, the command complete apis tries to access some already freed memory in reset sequence. CRs-fixed: 369658 Signed-off-by: Bhasker Neti <[email protected]> (cherry picked from commit 6f4ceb1) Signed-off-by: Ramakrishna Prasad N <[email protected]> (cherry picked from commit d686446) Signed-off-by: Ramakrishna Prasad N <[email protected]> (cherry picked from commit 69c592d) Change-Id: Ic4cb65d405a4928b5a45aaad9c1d8ad1f6e67907 Signed-off-by: Shruthi Krishna <[email protected]>
1 parent fc4df71 commit 4a9bceb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/bluetooth/hci_event.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,9 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
20362036

20372037
opcode = __le16_to_cpu(ev->opcode);
20382038

2039+
if (test_bit(HCI_RESET, &hdev->flags) && (opcode != HCI_OP_RESET))
2040+
return;
2041+
20392042
switch (opcode) {
20402043
case HCI_OP_INQUIRY_CANCEL:
20412044
hci_cc_inquiry_cancel(hdev, skb);

0 commit comments

Comments
 (0)