From d120465ceec97d2d2651c21341556d5856315409 Mon Sep 17 00:00:00 2001 From: Gurpreet Ghai Date: Tue, 8 Mar 2016 23:39:55 +0530 Subject: BT: ACL and l2c out if sync after connection collision Problem: Remote device can't be removed from paired list. Cause: After connection collision, lcb is removed after connection request is rejected by soc but acl entry is not removed. So, for upper layer, acl connection always remains up. Fix: Removed acl connection and acl entry when connection complete is received and lcb is not present. CRs-Fixed: 987968 Change-Id: Ie2049217e436704262f06d0c0dc51611697cc29a --- stack/l2cap/l2c_link.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c index 1432b1ae6..6e694d0f0 100644 --- a/stack/l2cap/l2c_link.c +++ b/stack/l2cap/l2c_link.c @@ -220,6 +220,13 @@ BOOLEAN l2c_link_hci_conn_comp (UINT8 status, UINT16 handle, BD_ADDR p_bda) if (!p_lcb) { L2CAP_TRACE_WARNING ("L2CAP got conn_comp for unknown BD_ADDR"); + + /* Connection complete received when no link control block is present for this address + * However ACL entry is already created + * Removing connection entry at ACL and sending disconnect because l2c and acl are out of sync */ + btm_remove_acl(p_bda, BT_TRANSPORT_BR_EDR); + btm_acl_removed(p_bda, BT_TRANSPORT_BR_EDR); + return (FALSE); } -- cgit v1.2.3