Skip to content

Commit d50f255

Browse files
apanditgregkh
authored andcommitted
Bluetooth: Always set event mask on suspend
commit ef61b6e upstream. When suspending, always set the event mask once disconnects are successful. Otherwise, if wakeup is disallowed, the event mask is not set before suspend continues and can result in an early wakeup. Fixes: 182ee45 ("Bluetooth: hci_sync: Rework hci_suspend_notifier") Cc: [email protected] Signed-off-by: Abhishek Pandit-Subedi <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3740a5d commit d50f255

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/bluetooth/hci_sync.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,6 +4942,9 @@ int hci_suspend_sync(struct hci_dev *hdev)
49424942
return err;
49434943
}
49444944

4945+
/* Update event mask so only the allowed event can wakeup the host */
4946+
hci_set_event_mask_sync(hdev);
4947+
49454948
/* Only configure accept list if disconnect succeeded and wake
49464949
* isn't being prevented.
49474950
*/
@@ -4953,9 +4956,6 @@ int hci_suspend_sync(struct hci_dev *hdev)
49534956
/* Unpause to take care of updating scanning params */
49544957
hdev->scanning_paused = false;
49554958

4956-
/* Update event mask so only the allowed event can wakeup the host */
4957-
hci_set_event_mask_sync(hdev);
4958-
49594959
/* Enable event filter for paired devices */
49604960
hci_update_event_filter_sync(hdev);
49614961

0 commit comments

Comments
 (0)