OSDN Git Service

LE: Fix for back-to-back GATT connection request issues
authorAndre Eisenbach <andre@broadcom.com>
Tue, 23 Jul 2013 22:57:27 +0000 (15:57 -0700)
committerMatthew Xie <mattx@google.com>
Wed, 14 Aug 2013 07:10:13 +0000 (00:10 -0700)
When two GATT client connections were sent back to back, the first
connection will not be processed due to an address comparison error.
This patch corrects the error.

Change-Id: I8eb97cd2a34a81da460f448dc71445b2898a5d32

bta/gatt/bta_gattc_utils.c

index 151b7ba..8392f8d 100644 (file)
@@ -172,8 +172,7 @@ tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_cif (UINT8 client_if, BD_ADDR remote_bd
     {
         if (p_clcb->in_use &&
             p_clcb->p_rcb->client_if == client_if &&
-            p_clcb->p_srcb &&
-            bdcmp(p_clcb->p_srcb->server_bda, remote_bda) == 0)
+            bdcmp(p_clcb->bda, remote_bda) == 0)
             return p_clcb;
     }
     return NULL;
@@ -400,7 +399,7 @@ tBTA_GATTC_SERV * bta_gattc_srcb_alloc(BD_ADDR bda)
     /* if not found, try to recycle one known device */
     if (!found && !p_recycle)
         p_tcb = NULL;
-    else if (p_recycle)
+    else if (!found && p_recycle)
         p_tcb = p_recycle;
 
     if (p_tcb != NULL)