Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern Ignore errors when copyin/out len ...
details: https://anonhg.NetBSD.org/src/rev/017e69b7ebdc
branches: trunk
changeset: 756463:017e69b7ebdc
user: pooka <pooka%NetBSD.org@localhost>
date: Sun Jul 18 12:44:31 2010 +0000
description:
Ignore errors when copyin/out len == 0.
diffstat:
sys/rump/librump/rumpkern/rumpcopy.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (40 lines):
diff -r b4346d81139c -r 017e69b7ebdc sys/rump/librump/rumpkern/rumpcopy.c
--- a/sys/rump/librump/rumpkern/rumpcopy.c Sun Jul 18 12:44:09 2010 +0000
+++ b/sys/rump/librump/rumpkern/rumpcopy.c Sun Jul 18 12:44:31 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpcopy.c,v 1.4 2010/07/12 21:00:47 pooka Exp $ */
+/* $NetBSD: rumpcopy.c,v 1.5 2010/07/18 12:44:31 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpcopy.c,v 1.4 2010/07/12 21:00:47 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpcopy.c,v 1.5 2010/07/18 12:44:31 pooka Exp $");
#include <sys/param.h>
#include <sys/lwp.h>
@@ -41,8 +41,9 @@
{
if (curproc->p_vmspace == &vmspace0) {
- if (uaddr == NULL)
+ if (__predict_false(uaddr == NULL && len)) {
return EFAULT;
+ }
memcpy(kaddr, uaddr, len);
} else {
rump_sysproxy_copyin(uaddr, kaddr, len);
@@ -55,8 +56,9 @@
{
if (curproc->p_vmspace == &vmspace0) {
- if (uaddr == NULL)
+ if (__predict_false(uaddr == NULL && len)) {
return EFAULT;
+ }
memcpy(uaddr, kaddr, len);
} else {
rump_sysproxy_copyout(kaddr, uaddr, len);
Home |
Main Index |
Thread Index |
Old Index