Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/common compat_50_sys_aio_suspend:



details:   https://anonhg.NetBSD.org/src/rev/c24eaf4d16a2
branches:  trunk
changeset: 748083:c24eaf4d16a2
user:      yamt <yamt%NetBSD.org@localhost>
date:      Mon Oct 12 23:41:51 2009 +0000

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

diffstat:

 sys/compat/common/kern_time_50.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r 8f5ca0a197b7 -r c24eaf4d16a2 sys/compat/common/kern_time_50.c
--- a/sys/compat/common/kern_time_50.c  Mon Oct 12 23:38:08 2009 +0000
+++ b/sys/compat/common/kern_time_50.c  Mon Oct 12 23:41:51 2009 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index