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

Commit 6fa9bbdb authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by Andre Eisenbach
Browse files

Remove the RFComm MCB from the ports when releasing it

Bug: 28849621
Change-Id: I3ce1c857d0d0a2c00c59d8f71b40685ae602dc29
parent 12d37c73
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -228,7 +228,6 @@ void PORT_StartCnf (tRFC_MCB *p_mcb, UINT16 result)
                    p_port->error = PORT_START_FAILED;

                rfc_release_multiplexer_channel (p_mcb);
                p_port->rfc.p_mcb = NULL;

                /* Send event to the application */
                if (p_port->p_callback && (p_port->ev_mask & PORT_EV_CONNECT_ERR))
+7 −2
Original line number Diff line number Diff line
@@ -198,8 +198,7 @@ tRFC_MCB *rfc_alloc_multiplexer_channel (BD_ADDR bd_addr, BOOLEAN is_initiator)
**
** Function         rfc_release_multiplexer_channel
**
** Description      This function returns existing or new control block for
**                  the BD_ADDR.
** Description      Release a multiplexer control block
**
*******************************************************************************/
void rfc_release_multiplexer_channel (tRFC_MCB *p_mcb)
@@ -207,6 +206,12 @@ void rfc_release_multiplexer_channel (tRFC_MCB *p_mcb)
    /* Remove the MCB from the mapping table */
    rfc_save_lcid_mcb(NULL, p_mcb->lcid);

    /* Remove the MCB from the ports */
    for (int i = 0; i < MAX_RFC_PORTS; i++) {
        if (rfc_cb.port.port[i].rfc.p_mcb == p_mcb)
            rfc_cb.port.port[i].rfc.p_mcb = NULL;
    }

    rfc_timer_stop (p_mcb);
    alarm_free(p_mcb->mcb_timer);