From: Warner Losh Date: Mon, 31 Jan 2022 20:40:36 +0000 (-0700) Subject: bsd-user/freebsd/os-syscall.c: unlock_iovec X-Git-Tag: v7.1.0-rc0~66^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=883808d84895804a3a98e211001c3edf42355b66;p=thirdparty%2Fqemu.git bsd-user/freebsd/os-syscall.c: unlock_iovec Releases the references to the iovec created by lock_iovec. Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 67851937a8f..52093d479d8 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -175,6 +175,20 @@ fail2: return NULL; } +void unlock_iovec(struct iovec *vec, abi_ulong target_addr, + int count, int copy) +{ + struct target_iovec *target_vec; + + target_vec = lock_user(VERIFY_READ, target_addr, + count * sizeof(struct target_iovec), 1); + if (target_vec) { + helper_unlock_iovec(target_vec, target_addr, vec, count, copy); + } + + g_free(vec); +} + /* * do_syscall() should always have a single exit point at the end so that * actions, such as logging of syscall results, can be performed. All errnos