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

Commit b6e34436 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

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

parents acfd7af5 3002d9dd
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;