Przeglądaj źródła

Merge branch 'bugfix/btdm_fix_write_char_crash_after_disconnection' into 'master'

Component/bt: fix write char crash after disconnection

See merge request idf/esp-idf!4209
Jiang Jiang Jian 7 lat temu
rodzic
commit
abea9e4c02
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      components/bt/bluedroid/stack/l2cap/l2c_api.c

+ 1 - 1
components/bt/bluedroid/stack/l2cap/l2c_api.c

@@ -1845,7 +1845,7 @@ BOOLEAN L2CA_CheckIsCongest(UINT16 fixed_cid, UINT16 handle)
     tL2C_LCB *p_lcb;
     tL2C_LCB *p_lcb;
     p_lcb = l2cu_find_lcb_by_handle(handle);
     p_lcb = l2cu_find_lcb_by_handle(handle);
 
 
-    if (p_lcb != NULL) {
+    if (p_lcb != NULL && p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL] != NULL) {
         return p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent;
         return p_lcb->p_fixed_ccbs[fixed_cid - L2CAP_FIRST_FIXED_CHNL]->cong_sent;
     }
     }