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

Commit 1c3b7df0 authored by Hemant Gupta's avatar Hemant Gupta Committed by android-build-merger
Browse files

HID: Prevent crash by Cancelling SDP during cleanup am: 10008bcd

am: 4a7f4aca

Change-Id: Ibfb0232678d95aa0dc362a56914bfb2c6257a2c4
parents faf48cfe 4a7f4aca
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -429,7 +429,12 @@ void bta_hh_cleanup_disable(tBTA_HH_STATUS status) {
    osi_free_and_reset(
        (void**)&bta_hh_cb.kdev[xx].dscp_info.descriptor.dsc_list);
  }

  if (bta_hh_cb.p_disc_db) {
    /* Cancel SDP if it had been started. */
    (void)SDP_CancelServiceSearch (bta_hh_cb.p_disc_db);
    osi_free_and_reset((void**)&bta_hh_cb.p_disc_db);
  }

  if (bta_hh_cb.p_cback) {
    (*bta_hh_cb.p_cback)(BTA_HH_DISABLE_EVT, (tBTA_HH*)&status);