OSDN Git Service

bsd-user/freebsd/os-syscall.c: unlock_iovec
authorWarner Losh <imp@bsdimp.com>
Mon, 31 Jan 2022 20:40:36 +0000 (13:40 -0700)
committerWarner Losh <imp@bsdimp.com>
Sat, 11 Jun 2022 04:00:48 +0000 (22:00 -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

index 6785193..52093d4 100644 (file)
@@ -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