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

Commit 98259263 authored by Matthew Xie's avatar Matthew Xie Committed by Android Git Automerger
Browse files

am b6e34436: Merge "Clean up fd when failed to add monitor thread" into lmp-dev

* commit 'b6e34436':
  Clean up fd when failed to add monitor thread
parents c2f9e2d0 b6e34436
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -343,8 +343,13 @@ bt_status_t btsock_rfc_listen(const char* service_name, const uint8_t* service_u
        BTA_JvCreateRecordByUser((void *)(intptr_t)rs->id);
        *sock_fd = rs->app_fd;
        rs->app_fd = -1; //the fd ownership is transferred to app
        if (btsock_thread_add_fd(pth, rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_EXCEPTION, rs->id)) {
            status = BT_STATUS_SUCCESS;
        btsock_thread_add_fd(pth, rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_EXCEPTION, rs->id);
        }
        else
        {
            cleanup_rfc_slot(rs);
        }
    }
    unlock_slot(&slot_lock);
    return status;