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

Commit 21a1454b authored by Harish Paryani's avatar Harish Paryani Committed by Matthew Xie
Browse files

Hid Host: Ensure Hid module is accepting events before processing

During shutdown sequence, Hid host module state machine was crashing
trying to process events in NULL state. Added the appropriate check.
bug 10429484
Change-Id: Ic8b8f61f2fa63027d3e473787cca6d4d221ec075
parent 0912d3dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -369,10 +369,10 @@ void bta_hh_sm_execute(tBTA_HH_DEV_CB *p_cb, UINT16 event, tBTA_HH_DATA * p_data
                          bta_hh_evt_code(debug_event));
#endif

        if (in_state >= BTA_HH_INVALID_ST)
        if ((p_cb->state == BTA_HH_NULL_ST) || (p_cb->state >= BTA_HH_INVALID_ST))
        {
            APPL_TRACE_ERROR2("bta_hh_sm_execute: Invalid state State = 0x%x, Event = %d",
                              in_state,event);
                              p_cb->state,event);
            return;
        }
        state_table = bta_hh_st_tbl[p_cb->state - 1];