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

Commit 9bb2730a authored by Pavlin Radoslavov's avatar Pavlin Radoslavov Committed by android-build-merger
Browse files

Remove the RFComm MCB from the ports when releasing it

am: 27a76f1d

* commit '27a76f1d':
  Remove the RFComm MCB from the ports when releasing it

Change-Id: I0a7c0a85026add0a4c892c01aea24af448e66c8c
parents dae3180f 27a76f1d
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);