Module Name:    src
Committed By:   bouyer
Date:           Sun May  3 13:07:39 UTC 2009

Modified Files:
        src/sys/kern [netbsd-5]: sys_module.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #729):
        sys/kern/sys_module.c: revision 1.9
copyin the modctl_load_t for the non-x86 world. Fixes PR/41294.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/kern/sys_module.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_module.c
diff -u src/sys/kern/sys_module.c:1.8 src/sys/kern/sys_module.c:1.8.4.1
--- src/sys/kern/sys_module.c:1.8	Wed Oct 22 11:16:29 2008
+++ src/sys/kern/sys_module.c	Sun May  3 13:07:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_module.c,v 1.8 2008/10/22 11:16:29 ad Exp $	*/
+/*	$NetBSD: sys_module.c,v 1.8.4.1 2009/05/03 13:07:39 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.8 2008/10/22 11:16:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.8.4.1 2009/05/03 13:07:39 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -44,10 +44,8 @@
 #include <sys/syscallargs.h>
 
 static int
-handle_modctl_load(void *arg)
+handle_modctl_load(modctl_load_t *ml)
 {
-	modctl_load_t *ml = (modctl_load_t *)arg;
-
 	char *path;
 	char *props;
 	int error;
@@ -111,6 +109,7 @@
 	vaddr_t addr;
 	size_t size;
 	struct iovec iov;
+	modctl_load_t ml;
 	int error;
 	void *arg;
 
@@ -118,7 +117,10 @@
 
 	switch (SCARG(uap, cmd)) {
 	case MODCTL_LOAD:
-		error = handle_modctl_load(arg);
+		error = copyin(arg, &ml, sizeof(ml));
+		if (error != 0)
+			break;
+		error = handle_modctl_load(&ml);
 		break;
 
 	case MODCTL_UNLOAD:

Reply via email to