[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec
From: |
Warner Losh |
Subject: |
[PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec |
Date: |
Tue, 7 Jun 2022 14:14:36 -0600 |
Releases the references to the iovec created by lock_iovec.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
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 c41ef0eda40..510307f29d9 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -186,6 +186,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
- [PATCH 0/6] bsd-user upstreaming: read, write and exit, Warner Losh, 2022/06/07
- [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec,
Warner Losh <=
- Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec, Richard Henderson, 2022/06/07
- Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec, Warner Losh, 2022/06/07
- Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec, Richard Henderson, 2022/06/07
- Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec, Warner Losh, 2022/06/07
- Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec, Richard Henderson, 2022/06/07
- Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec, Warner Losh, 2022/06/08
[PATCH 3/6] bsd-user/freebsd/os-syscall.c: Tracing and error boilerplate, Warner Losh, 2022/06/07
[PATCH 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec, Warner Losh, 2022/06/07