]> xenbits.xensource.com Git - people/aperard/linux.git/commitdiff
Bluetooth: hci_sync: Fix accept_list when attempting to suspend
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 5 Jan 2024 15:43:26 +0000 (10:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:45:07 +0000 (14:45 +0000)
[ Upstream commit e5469adb2a7e930d96813316592302d9f8f1df4e ]

During suspend, only wakeable devices can be in acceptlist, so if the
device was previously added it needs to be removed otherwise the device
can end up waking up the system prematurely.

Fixes: 3b42055388c3 ("Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan")
Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_sync.c

index 13ed6cbfade3e51c570160693d867ffe849c1e93..a33734046456723532ef0120a56b9cb892e622ed 100644 (file)
@@ -2251,8 +2251,11 @@ static int hci_le_add_accept_list_sync(struct hci_dev *hdev,
 
        /* During suspend, only wakeable devices can be in acceptlist */
        if (hdev->suspended &&
-           !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP))
+           !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
+               hci_le_del_accept_list_sync(hdev, &params->addr,
+                                           params->addr_type);
                return 0;
+       }
 
        /* Select filter policy to accept all advertising */
        if (*num_entries >= hdev->le_accept_list_size)