bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] [ipc_kmsg.c] Set kr if copy cannot be copied to user space


From: Flavio Cruz
Subject: [PATCH] [ipc_kmsg.c] Set kr if copy cannot be copied to user space
Date: Tue, 24 Jan 2023 00:10:45 -0500

Compiler will complain otherwise that kr is not initialized.
---
 ipc/ipc_kmsg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c
index 2c9d4988..dac4f5dc 100644
--- a/ipc/ipc_kmsg.c
+++ b/ipc/ipc_kmsg.c
@@ -2466,8 +2466,10 @@ ipc_kmsg_copyout_body(
                                        mach_port_t *src = (mach_port_t*)data;
                                        mach_port_name_t *dst = 
(mach_port_name_t*)addr;
                                        for (int i=0; i<number; i++) {
-                                               if (copyout_port(src + i, dst + 
i))
+                                               if (copyout_port(src + i, dst + 
i)) {
+                                                       kr = KERN_FAILURE;
                                                        goto vm_copyout_failure;
+                                               }
                                        }
                                } else {
                                        (void) copyoutmap(map, (char *) data,
-- 
2.39.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]