summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-30 08:35:48 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-30 19:28:41 +0200
commit6f78fd4bb93e17543f2f6f25112687c633c12eb7 (patch)
treebca05443bff272d4eb95ce562eff2dc20e12eb12 /net/bluetooth
parent233351bd66f1fadc4a69f350a9a4422c2e3d308d (diff)
downloadop-kernel-dev-6f78fd4bb93e17543f2f6f25112687c633c12eb7.zip
op-kernel-dev-6f78fd4bb93e17543f2f6f25112687c633c12eb7.tar.gz
Bluetooth: Fix check for connected state when pairing
Both BT_CONNECTED and BT_CONFIG state mean that we have a baseband link available. We should therefore check for either of these when pairing and deciding whether to call hci_conn_security() directly. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 5d18efcb..0b15b76 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3213,7 +3213,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
conn->io_capability = cp->io_cap;
cmd->user_data = conn;
- if (conn->state == BT_CONNECTED &&
+ if ((conn->state == BT_CONNECTED || conn->state == BT_CONFIG) &&
hci_conn_security(conn, sec_level, auth_type, true))
pairing_complete(cmd, 0);
OpenPOWER on IntegriCloud