aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2011-03-28 13:21:26 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2011-03-28 13:21:26 +0000
commit937060a8433525dc6ed7857ffd2b661719a5683c (patch)
tree3b999fcf1064d910dfbb09855482d5d2884848d0 /sys/kern
parent0f502d1c4e60dc883af7dfc7833956d62db9ff69 (diff)
downloadsrc-937060a8433525dc6ed7857ffd2b661719a5683c.tar.gz
src-937060a8433525dc6ed7857ffd2b661719a5683c.zip
Handle zero length in copyout_unmap().
Submitted by: John Wehle <john feith com> MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=220101
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_uio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c
index 8304aeaf2d80..d8fa68f37e0b 100644
--- a/sys/kern/subr_uio.c
+++ b/sys/kern/subr_uio.c
@@ -498,6 +498,9 @@ copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz)
vm_map_t map;
vm_size_t size;
+ if (sz == 0)
+ return (0);
+
map = &td->td_proc->p_vmspace->vm_map;
size = (vm_size_t) round_page(sz);