From: Lukasz Rymanowski Date: Wed, 11 Feb 2015 11:31:41 +0000 (+0100) Subject: Bluetooth: Improve error handling in connect acl X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c411110e1f13abd64886c8abdf6f31c10136969f;p=linux-beck.git Bluetooth: Improve error handling in connect acl With this patch -EOPNOTSUPP will be returned by hci_connect_acl for LE only controllers. If it is dual device with disabled BREDR -ECONNREFUSED will be returned Signed-off-by: Lukasz Rymanowski Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 409c05e9e00a..e3263b61bcf3 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -864,8 +864,12 @@ struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, { struct hci_conn *acl; - if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) + if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) { + if (lmp_bredr_capable(hdev)) + return ERR_PTR(-ECONNREFUSED); + return ERR_PTR(-EOPNOTSUPP); + } acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst); if (!acl) {