summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-07-11 14:46:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-11 14:46:59 -0400
commitd8598981146241064993e371cea8333f59553cb6 (patch)
treebb92a46fb9fe75ee9c4fdbbe0a5b6eafc6818ef3 /net/bluetooth/l2cap_core.c
parent8ae2e12f1534e647d4a816755e5a09c2de6f9fca (diff)
parent34459512ffa7236c849466e3bd604801389734e1 (diff)
downloadop-kernel-dev-d8598981146241064993e371cea8333f59553cb6.zip
op-kernel-dev-d8598981146241064993e371cea8333f59553cb6.tar.gz
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts: drivers/net/wireless/ath/ath5k/sysfs.c net/bluetooth/l2cap_core.c net/mac80211/wpa.c
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 9ec9c8c..fc219ec 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2530,7 +2530,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
sk = chan->sk;
- if (chan->state != BT_CONFIG) {
+ if ((bt_sk(sk)->defer_setup && chan->state != BT_CONNECT2) ||
+ (!bt_sk(sk)->defer_setup && chan->state != BT_CONFIG)) {
struct l2cap_cmd_rej rej;
rej.reason = cpu_to_le16(0x0002);
@@ -2541,7 +2542,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
/* Reject if config buffer is too small. */
len = cmd_len - sizeof(*req);
- if (chan->conf_len + len > sizeof(chan->conf_req)) {
+ if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) {
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
l2cap_build_conf_rsp(chan, rsp,
L2CAP_CONF_REJECT, flags), rsp);
OpenPOWER on IntegriCloud