system/bt
Revision | de75b705a241a6e2003d1d2b1071ce8501631c63 (tree) |
---|---|
Zeit | 2017-05-27 02:34:55 |
Autor | TreeHugger Robot <treehugger-gerrit@goog...> |
Commiter | Android (Google) Code Review |
Merge "Fix crashes when GAP operation is interrupted by disconnection" into oc-dev
@@ -87,15 +87,7 @@ tGAP_CLCB* gap_find_clcb_by_bd_addr(BD_ADDR bda) { | ||
87 | 87 | return NULL; |
88 | 88 | } |
89 | 89 | |
90 | -/******************************************************************************* | |
91 | - * | |
92 | - * Function gap_ble_find_clcb_by_conn_id | |
93 | - * | |
94 | - * Description The function searches all LCB with macthing connection ID | |
95 | - * | |
96 | - * Returns total number of clcb found. | |
97 | - * | |
98 | - ******************************************************************************/ | |
90 | +/* returns LCB with matching connection ID, or NULL if not found */ | |
99 | 91 | tGAP_CLCB* gap_ble_find_clcb_by_conn_id(uint16_t conn_id) { |
100 | 92 | uint8_t i_clcb; |
101 | 93 | tGAP_CLCB* p_clcb = NULL; |
@@ -107,7 +99,7 @@ tGAP_CLCB* gap_ble_find_clcb_by_conn_id(uint16_t conn_id) { | ||
107 | 99 | } |
108 | 100 | } |
109 | 101 | |
110 | - return p_clcb; | |
102 | + return NULL; | |
111 | 103 | } |
112 | 104 | |
113 | 105 | /******************************************************************************* |
@@ -132,10 +124,10 @@ tGAP_CLCB* gap_clcb_alloc(BD_ADDR bda) { | ||
132 | 124 | p_clcb->in_use = true; |
133 | 125 | memcpy(p_clcb->bda, bda, BD_ADDR_LEN); |
134 | 126 | p_clcb->pending_req_q = fixed_queue_new(SIZE_MAX); |
135 | - break; | |
127 | + return p_clcb; | |
136 | 128 | } |
137 | 129 | } |
138 | - return p_clcb; | |
130 | + return NULL; | |
139 | 131 | } |
140 | 132 | |
141 | 133 | /******************************************************************************* |