summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/hci_sync.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 84fe44c796f4..02661d42bf56 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -6687,6 +6687,9 @@ static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data)
struct hci_cp_create_conn cp;
int err;
+ if (!hci_conn_valid(hdev, conn))
+ return -ECANCELED;
+
/* Many controllers disallow HCI Create Connection while it is doing
* HCI Inquiry. So we cancel the Inquiry first before issuing HCI Create
* Connection. This may cause the MGMT discovering state to become false