From bea3787d6eff0e8842dd7ae277bf8b7adb828058 Mon Sep 17 00:00:00 2001 From: Noah Woo <68975706+namyoonw@users.noreply.github.com> Date: Fri, 3 Jan 2025 18:59:13 +0000 Subject: [PATCH] [kernel][port] add a missing THREAD_UNLOCK call in port_group_remove() 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. --- kernel/port.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/port.c b/kernel/port.c index 028cdbf83f..f5f07f6f42 100644 --- a/kernel/port.c +++ b/kernel/port.c @@ -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);