Skip to content

Commit 61a5ab7

Browse files
zijun-huVudentz
authored andcommitted
Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR
hci_store_wake_reason() wrongly parses event HCI_Connection_Request as HCI_Connection_Complete and HCI_Connection_Complete as HCI_Connection_Request, so causes recording wakeup BD_ADDR error and potential stability issue, fix it by using the correct field. Fixes: 2f20216 ("Bluetooth: Emit controller suspend and resume events") Signed-off-by: Zijun Hu <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 2535b84 commit 61a5ab7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bluetooth/hci_event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event,
74207420
* keep track of the bdaddr of the connection event that woke us up.
74217421
*/
74227422
if (event == HCI_EV_CONN_REQUEST) {
7423-
bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
7423+
bacpy(&hdev->wake_addr, &conn_request->bdaddr);
74247424
hdev->wake_addr_type = BDADDR_BREDR;
74257425
} else if (event == HCI_EV_CONN_COMPLETE) {
7426-
bacpy(&hdev->wake_addr, &conn_request->bdaddr);
7426+
bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
74277427
hdev->wake_addr_type = BDADDR_BREDR;
74287428
} else if (event == HCI_EV_LE_META) {
74297429
struct hci_ev_le_meta *le_ev = (void *)skb->data;

0 commit comments

Comments
 (0)