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

Commit 62c92f0c authored by Josh Gao's avatar Josh Gao
Browse files

adb: add lock to remove_socket.

The comment that was previously here says that local_socket_list_lock
must be taken, but this function is exposed to external callers that
can't possibly take the lock.

Bug: http://b/65419665
Test: python test_device.py
Change-Id: I12d464933936b2a210a827ccf19ea201020d8d78
parent 55c8b34f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ void install_local_socket(asocket* s) {
}

void remove_socket(asocket* s) {
    // socket_list_lock should already be held
    std::lock_guard<std::recursive_mutex> lock(local_socket_list_lock);
    if (s->prev && s->next) {
        s->prev->next = s->next;
        s->next->prev = s->prev;