summaryrefslogtreecommitdiff
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-06-26 19:36:30 +0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-06-26 19:36:30 +0400
commitb82c29d81df0ead8b66041702d1dd88e778ab806 (patch)
treeb84f27dfe6a497c19f84e0419204c3ac600445eb /net/bluetooth/mgmt.c
parent790eff4429e45b850859f1bb8117846dafd5f86a (diff)
parentea1e76a3f92f8565d395c549b9ca836c7eaa44b9 (diff)
downloadlinux-b82c29d81df0ead8b66041702d1dd88e778ab806.tar.xz
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Diffstat (limited to 'net/bluetooth/mgmt.c')
-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 2f9f52f19b48..e83368fe5690 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1598,7 +1598,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
else
conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr);
- if (!conn) {
+ if (!conn || conn->state == BT_OPEN || conn->state == BT_CLOSED) {
err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT,
MGMT_STATUS_NOT_CONNECTED);
goto failed;