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

Commit e81d13b4 authored by Myles Watson's avatar Myles Watson
Browse files

hfp: Check if cb was allocated

Bug: 191215961
Tag: #stability
Test: atest BluetoothInstrumentationTests
Change-Id: I29cc97110d400d1f314f1d2ca6bf11d5640a8939
parent 39d47fab
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -827,6 +827,11 @@ static void btif_hf_client_upstreams_evt(uint16_t event, char* p_param) {
    BTIF_TRACE_DEBUG("%s: event BTA_HF_CLIENT_OPEN_EVT allocating block",
                     __func__);
    cb = btif_hf_client_allocate_cb();
    if (cb == NULL) {
      BTIF_TRACE_ERROR("%s: event BTA_HF_CLIENT_OPEN_EVT failed to allocate cb",
                       __func__, event);
      return;
    }
    cb->handle = p_data->open.handle;
    cb->peer_bda = p_data->open.bd_addr;
  } else if (cb == NULL) {