linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded
@ 2024-01-09  8:37 Zijun Hu
  2024-01-09  9:32 ` [v1,1/1] " bluez.test.bot
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Zijun Hu @ 2024-01-09  8:37 UTC (permalink / raw)
  To: luiz.dentz, marcel, johan.hedberg; +Cc: linux-bluetooth, quic_zijuhu, stable

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
stability issue, it is fixed by this change.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 net/bluetooth/hci_event.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ef8c3bed7361..22b22c264c2a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -7420,10 +7420,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event,
 	 * keep track of the bdaddr of the connection event that woke us up.
 	 */
 	if (event == HCI_EV_CONN_REQUEST) {
-		bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
+		bacpy(&hdev->wake_addr, &conn_request->bdaddr);
 		hdev->wake_addr_type = BDADDR_BREDR;
 	} else if (event == HCI_EV_CONN_COMPLETE) {
-		bacpy(&hdev->wake_addr, &conn_request->bdaddr);
+		bacpy(&hdev->wake_addr, &conn_complete->bdaddr);
 		hdev->wake_addr_type = BDADDR_BREDR;
 	} else if (event == HCI_EV_LE_META) {
 		struct hci_ev_le_meta *le_ev = (void *)skb->data;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-09 17:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09  8:37 [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded Zijun Hu
2024-01-09  9:32 ` [v1,1/1] " bluez.test.bot
2024-01-09  9:58 ` [PATCH v1 1/1] " Paul Menzel
2024-01-09 10:39   ` quic_zijuhu
2024-01-09 11:03 ` [PATCH v2 1/1] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Zijun Hu
2024-01-09 11:30   ` [v2,1/1] " bluez.test.bot
2024-01-09 17:00   ` [PATCH v2 1/1] " patchwork-bot+bluetooth
2024-01-09 17:00 ` [PATCH v1 1/1] Bluetooth: hci_event: Fix wakeup BD_ADDR are wrongly recorded patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).