summaryrefslogtreecommitdiffstats
path: root/bsd-user
diff options
context:
space:
mode:
authorWarner Losh2022-01-31 21:40:36 +0100
committerWarner Losh2022-06-11 06:00:48 +0200
commit883808d84895804a3a98e211001c3edf42355b66 (patch)
treed667a1ef903291746e1478b1708a67d30e91beee /bsd-user
parentbsd-user/freebsd/os-syscall.c: lock_iovec (diff)
downloadqemu-883808d84895804a3a98e211001c3edf42355b66.tar.gz
qemu-883808d84895804a3a98e211001c3edf42355b66.tar.xz
qemu-883808d84895804a3a98e211001c3edf42355b66.zip
bsd-user/freebsd/os-syscall.c: unlock_iovec
Releases the references to the iovec created by lock_iovec. Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'bsd-user')
-rw-r--r--bsd-user/freebsd/os-syscall.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index 67851937a8..52093d479d 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