Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caf8c490 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Add a log message to capture empty queue in l2c_enqueue_peer_data()

Add a log message in l2c_enqueue_peer_data() to help capture
an empty queue p_ccb->xmit_hold_q that is triggering an assert.

Also:
 * Fix a memory leak inside l2cu_initialize_fixed_ccb()
   p_ccb queues have been allocated again even though
   they have been allocated previously within l2cu_allocate_ccb()
 * Fix a typo in a comment: clodes -> closed
 * Removed repeated function declarations in file l2c_int.h

Bug: 27821847
Change-Id: I2df2843710310acf5a46c6fa5b302cf7390bc1b4
parent d5223550
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1496,6 +1496,11 @@ void l2c_enqueue_peer_data (tL2C_CCB *p_ccb, BT_HDR *p_buf)
        UINT16_TO_STREAM (p, p_ccb->remote_cid);
    }

    if (p_ccb->xmit_hold_q == NULL) {
      L2CAP_TRACE_ERROR("%s: empty queue: p_ccb = %p p_ccb->in_use = %d p_ccb->chnl_state = %d p_ccb->local_cid = %u p_ccb->remote_cid = %u",
                        __func__, p_ccb, p_ccb->in_use, p_ccb->chnl_state,
                        p_ccb->local_cid, p_ccb->remote_cid);
    }
    fixed_queue_enqueue(p_ccb->xmit_hold_q, p_buf);

    l2cu_check_channel_congestion (p_ccb);
+1 −11
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@
*/
typedef enum
{
    CST_CLOSED,                           /* Channel is in clodes state           */
    CST_CLOSED,                           /* Channel is in closed state           */
    CST_ORIG_W4_SEC_COMP,                 /* Originator waits security clearence  */
    CST_TERM_W4_SEC_COMP,                 /* Acceptor waits security clearence    */
    CST_W4_L2CAP_CONNECT_RSP,             /* Waiting for peer conenct response    */
@@ -658,16 +658,6 @@ BOOLEAN l2c_ucd_check_rx_pkts(tL2C_LCB *p_lcb, BT_HDR *p_msg);
BOOLEAN l2c_ucd_process_event(tL2C_CCB *p_ccb, UINT16 event, void *p_data);
#endif

#if (BLE_INCLUDED == TRUE)
extern void l2cu_send_peer_ble_par_req (tL2C_LCB *p_lcb, UINT16 min_int, UINT16 max_int, UINT16 latency, UINT16 timeout);
extern void l2cu_send_peer_ble_par_rsp (tL2C_LCB *p_lcb, UINT16 reason, UINT8 rem_id);
#endif

extern BOOLEAN l2cu_initialize_fixed_ccb (tL2C_LCB *p_lcb, UINT16 fixed_cid, tL2CAP_FCR_OPTS *p_fcr);
extern void    l2cu_no_dynamic_ccbs (tL2C_LCB *p_lcb);
extern void    l2cu_process_fixed_chnl_resp (tL2C_LCB *p_lcb);


/* Functions provided for Broadcom Aware
****************************************
*/
+0 −5
Original line number Diff line number Diff line
@@ -2748,11 +2748,6 @@ BOOLEAN l2cu_initialize_fixed_ccb (tL2C_LCB *p_lcb, UINT16 fixed_cid, tL2CAP_FCR
    p_ccb->local_cid  = fixed_cid;
    p_ccb->remote_cid = fixed_cid;

    p_ccb->xmit_hold_q = fixed_queue_new(SIZE_MAX);
    p_ccb->fcrb.srej_rcv_hold_q = fixed_queue_new(SIZE_MAX);
    p_ccb->fcrb.retrans_q = fixed_queue_new(SIZE_MAX);
    p_ccb->fcrb.waiting_for_ack_q = fixed_queue_new(SIZE_MAX);

    p_ccb->is_flushable = FALSE;

    if (p_fcr)