Module Name:    src
Committed By:   yamt
Date:           Mon Oct 12 23:41:51 UTC 2009

Modified Files:
        src/sys/compat/common: kern_time_50.c

Log Message:
compat_50_sys_aio_suspend:
        - fix the buffer size.
        - use kmem_alloc instead of kmem_zalloc for buffers which we will
          overwrite soon.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/kern_time_50.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/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.9 src/sys/compat/common/kern_time_50.c:1.10
--- src/sys/compat/common/kern_time_50.c:1.9	Mon Oct  5 23:49:47 2009
+++ src/sys/compat/common/kern_time_50.c	Mon Oct 12 23:41:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.9 2009/10/05 23:49:47 rmind Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.10 2009/10/12 23:41:51 yamt Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.9 2009/10/05 23:49:47 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.10 2009/10/12 23:41:51 yamt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -386,13 +386,13 @@
 			return error;
 		timespec50_to_timespec(&ts50, &ts);
 	}
-	list = kmem_zalloc(nent * sizeof(struct aio_job), KM_SLEEP);
-	error = copyin(SCARG(uap, list), list, nent * sizeof(struct aiocb));
+	list = kmem_alloc(nent * sizeof(*list), KM_SLEEP);
+	error = copyin(SCARG(uap, list), list, nent * sizeof(*list));
 	if (error)
 		goto out;
 	error = aio_suspend1(l, list, nent, SCARG(uap, timeout) ? &ts : NULL);
 out:
-	kmem_free(list, nent * sizeof(struct aio_job));
+	kmem_free(list, nent * sizeof(*list));
 	return error;
 #else
 	return ENOSYS;

Reply via email to