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

Commit 807f359f authored by Ian Pedowitz's avatar Ian Pedowitz
Browse files

Revert "Avoid double memory free and crash during LE discovery or disconnect"

This reverts commit 7e9656ac.

Change-Id: I01deaa5024bfef1782887fd8f8137f83916d8be0
parent 7e9656ac
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1064,10 +1064,8 @@ void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
    else if (p_q_cmd != NULL)
    {
        p_clcb->p_q_cmd = NULL;
        /* execute pending operation of link block still present */
        if (l2cu_find_lcb_by_bd_addr(p_clcb->p_srcb->server_bda, BT_TRANSPORT_LE) != NULL) {

        bta_gattc_sm_execute(p_clcb, p_q_cmd->hdr.event, p_q_cmd);
        }
        /* if the command executed requeued the cmd, we don't
         * want to free the underlying buffer that's being
         * referenced by p_clcb->p_q_cmd
+10 −8
Original line number Diff line number Diff line
@@ -443,12 +443,14 @@ BOOLEAN bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
 if (p_clcb->p_q_cmd == NULL)
 {
     p_clcb->p_q_cmd = p_data;
        return TRUE;
 }

    APPL_TRACE_ERROR ("%s: already has a pending command!!", __func__);
 else
 {
     APPL_TRACE_ERROR("already has a pending command!!");
     /* skip the callback now. ----- need to send callback ? */
    return FALSE;
 }
 return (p_clcb->p_q_cmd != NULL) ? TRUE : FALSE;

}

/*******************************************************************************