Skip to content

Commit

Permalink
[kernel][port] add a missing THREAD_UNLOCK call in port_group_remove()
Browse files Browse the repository at this point in the history
port_group_remove() used to return without unlocking a thread if no
matching read port is found, which is not correct. This patch adds a
call to THREAD_UNLOCK before it returns ERR_BAD_HANDLE.
  • Loading branch information
namyoonw authored and travisg committed Jan 4, 2025
1 parent 6f32a0f commit bea3787
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ status_t port_group_remove(port_t group, port_t port) {
}
}

if (!found)
if (!found) {
THREAD_UNLOCK(state);
return ERR_BAD_HANDLE;
}

list_delete(&rp->g_node);

Expand Down

0 comments on commit bea3787

Please sign in to comment.