From 55f2a62dff1b7a0fc9f6ce04a574b4d7a47b33cc Mon Sep 17 00:00:00 2001 From: Mat Martineau Date: Mon, 19 Sep 2011 13:20:17 -0700 Subject: [PATCH] Bluetooth: Wait for info response before accepting AMP connection An incoming AMP "create channel" connection would trigger an info request and an AMP physical accept sequence at the same time. Since accepting an AMP physical link is a local operation, it would complete quickly and send a config request before the info response was received. If there is an outstanding info request, the AMP physical link should not be accepted yet. Existing logic in l2cap_conn_start() will accept the physical link when the info response is received. CRs-fixed: 307243 Signed-off-by: Mat Martineau --- net/bluetooth/l2cap_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 3bb58f9c34a..997928d9474 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4711,9 +4711,11 @@ static inline int l2cap_create_channel_req(struct l2cap_conn *conn, sk = l2cap_create_connect(conn, cmd, data, L2CAP_CREATE_CHAN_RSP, req->amp_id); - l2cap_pi(sk)->conf_state |= L2CAP_CONF_LOCKSTEP; + if (sk) + l2cap_pi(sk)->conf_state |= L2CAP_CONF_LOCKSTEP; - if (sk && req->amp_id) + if (sk && req->amp_id && + (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE)) amp_accept_physical(conn, req->amp_id, sk); return 0;