diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-06-19 16:00:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-19 16:00:11 -0400 |
commit | 69d4cfef8befc6ed89e5e3280f3170eb3153d57a (patch) | |
tree | 63420f8bdf0b26931f7a773bde10ae0ecb3fa3a7 /net | |
parent | 858faa57dd9e2b91f3f870fbb1185982e42f5a2b (diff) | |
parent | ea1e76a3f92f8565d395c549b9ca836c7eaa44b9 (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 14 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 8394e3615ef6..4554e80d16a3 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -2915,12 +2915,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len) | |||
2915 | while (len >= L2CAP_CONF_OPT_SIZE) { | 2915 | while (len >= L2CAP_CONF_OPT_SIZE) { |
2916 | len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); | 2916 | len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val); |
2917 | 2917 | ||
2918 | switch (type) { | 2918 | if (type != L2CAP_CONF_RFC) |
2919 | case L2CAP_CONF_RFC: | 2919 | continue; |
2920 | if (olen == sizeof(rfc)) | 2920 | |
2921 | memcpy(&rfc, (void *)val, olen); | 2921 | if (olen != sizeof(rfc)) |
2922 | goto done; | 2922 | break; |
2923 | } | 2923 | |
2924 | memcpy(&rfc, (void *)val, olen); | ||
2925 | goto done; | ||
2924 | } | 2926 | } |
2925 | 2927 | ||
2926 | /* Use sane default values in case a misbehaving remote device | 2928 | /* Use sane default values in case a misbehaving remote device |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 991d5b667674..3e5e3362ea00 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, | |||
1598 | else | 1598 | else |
1599 | conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); | 1599 | conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr); |
1600 | 1600 | ||
1601 | if (!conn) { | 1601 | if (!conn || conn->state == BT_OPEN || conn->state == BT_CLOSED) { |
1602 | err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, | 1602 | err = cmd_status(sk, hdev->id, MGMT_OP_DISCONNECT, |
1603 | MGMT_STATUS_NOT_CONNECTED); | 1603 | MGMT_STATUS_NOT_CONNECTED); |
1604 | goto failed; | 1604 | goto failed; |