diff mbox series

[62/66] bsd-user: freebsd_rw_wrlock needs to unlock_user_struct on this path

Message ID 20260515-misc-2026q2-v1-62-5438ca41b27a@bsdimp.com
State New
Headers show
Series bsd-user: Upstream most of the remaining system calls | expand

Commit Message

Warner Losh May 15, 2026, 9:20 p.m. UTC
We need to unlock the struct on all the return paths. We didn't on this
one.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 bsd-user/freebsd/os-thread.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c
index a36c5ceccf..86dea0aea2 100644
--- a/bsd-user/freebsd/os-thread.c
+++ b/bsd-user/freebsd/os-thread.c
@@ -1350,6 +1350,7 @@  abi_long freebsd_rw_wrlock(abi_ulong target_addr, long fflag, size_t tsz,
                 tswap32(state));
             ret = get_errno(safe__umtx_op(&target_urwlock->rw_state,
                 UMTX_OP_WAKE, INT_MAX, NULL, NULL));
+            unlock_user_struct(target_urwlock, target_addr, ret == 0);
             return ret;
         }
         /* re-read the state */