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

Commit 9e05f7bb authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Jakub Pawlowski
Browse files

btm_iso: Fix couple of asserts

LOG_ASSERT we are using to make sure that API is called properly.
This patch removes couple of asserts which are in the places where
stack gets response from the controller.
It is because it might happen that on such events iso is already gone
because of the disconnection, therefor we should handle it gracefully.

Bug: 159786353
Tag: #feature
Test: atest --host net_test_btm_iso
Sponsor: jpawlowski@

Change-Id: I6ff8b007f115fd0289a2afa8ba173daf9b70977a
parent 66bee3fc
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -234,7 +234,12 @@ struct iso_impl {
    STREAM_TO_UINT16(conn_handle, stream);

    iso_base* iso = GetIsoIfKnown(conn_handle);
    LOG_ASSERT(iso != nullptr) << "Invalid connection handle: " << +conn_handle;
    if (iso == nullptr) {
      /* That can happen when ACL has been disconnected while ISO patch was
       * creating */
      LOG(WARNING) << __func__ << "Invalid connection handle: " << +conn_handle;
      return;
    }

    if (status == HCI_SUCCESS) iso->state_flags |= kStateFlagHasDataPathSet;
    if (iso->state_flags & kStateFlagIsBroadcast) {
@@ -274,7 +279,12 @@ struct iso_impl {
    STREAM_TO_UINT16(conn_handle, stream);

    iso_base* iso = GetIsoIfKnown(conn_handle);
    LOG_ASSERT(iso != nullptr) << "Invalid connection handle: " << +conn_handle;
    if (iso == nullptr) {
      /* That could happen when ACL has been disconnected while removing data
       * path */
      LOG(WARNING) << __func__ << "Invalid connection handle: " << +conn_handle;
      return;
    }

    if (status == HCI_SUCCESS) iso->state_flags &= ~kStateFlagHasDataPathSet;

@@ -321,7 +331,12 @@ struct iso_impl {
    STREAM_TO_UINT16(conn_handle, stream);

    iso_base* iso = GetIsoIfKnown(conn_handle);
    LOG_ASSERT(iso != nullptr) << "Invalid connection handle: " << +conn_handle;
    if (iso == nullptr) {
      /* That could happen when ACL has been disconnected while waiting on the
       * read respose */
      LOG(WARNING) << __func__ << "Invalid connection handle: " << +conn_handle;
      return;
    }

    STREAM_TO_UINT32(txUnackedPackets, stream);
    STREAM_TO_UINT32(txFlushedPackets, stream);