OSDN Git Service

Bluetooth: Fix auto-creation of hci_conn at Conn Complete event
authorSonny Sasaka <sonnysasaka@chromium.org>
Fri, 14 Aug 2020 19:09:09 +0000 (12:09 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 20 Sep 2020 06:21:14 +0000 (08:21 +0200)
commita46b7ed4d52d09bd6c7ab53b2217d04fc2f02c65
treed0393371e7624766a900b8bef029bb284145c8c8
parente99f38b81107c572392c3c6b859d063344afd865
Bluetooth: Fix auto-creation of hci_conn at Conn Complete event

Currently the code auto-creates hci_conn only if the remote address has
been discovered before. This may not be the case. For example, the
remote device may trigger connection after reboot at already-paired
state so there is no inquiry result found, but it is still correct to
create the hci_conn when Connection Complete event is received.

A better guard is to check against bredr allowlist. Devices in the
allowlist have been given permission to auto-connect.

Fixes: 4f40afc6c764 ("Bluetooth: Handle BR/EDR devices during suspend")
Signed-off-by: Sonny Sasaka <sonnysasaka@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c