[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec
From: |
Warner Losh |
Subject: |
[PULL 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec |
Date: |
Sat, 11 Jun 2022 07:55:10 -0600 |
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>
---
bsd-user/freebsd/os-syscall.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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
--
2.33.1
- [PULL 0/6] Bsd user preen 2022q2 patches, Warner Losh, 2022/06/11
- [PULL 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec, Warner Losh, 2022/06/11
- [PULL 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec,
Warner Losh <=
- [PULL 5/6] bsd-user/bsd-file.h: Meat of the write system calls, Warner Losh, 2022/06/11
- [PULL 6/6] bsd-user/freebsd/os-syscall.c: Implement exit, Warner Losh, 2022/06/11
- [PULL 4/6] bsd-user/bsd-file.h: Add implementations for read, pread, readv and preadv, Warner Losh, 2022/06/11
- [PULL 3/6] bsd-user/freebsd/os-syscall.c: Tracing and error boilerplate, Warner Losh, 2022/06/11
- Re: [PULL 0/6] Bsd user preen 2022q2 patches, Richard Henderson, 2022/06/12