aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_time.c
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2003-01-19 06:51:10 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2003-01-19 06:51:10 +0000
commit31f3e2ad8e581a202c520e6b33a97ee56770a877 (patch)
treed890b8b95d64eeeca8870bbe3a407d8d181f0d21 /sys/kern/kern_time.c
parent9d683ffd4b8616aa69bc158f2ef2e942fd7c2115 (diff)
downloadsrc-31f3e2ad8e581a202c520e6b33a97ee56770a877.tar.gz
src-31f3e2ad8e581a202c520e6b33a97ee56770a877.zip
Notes
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r--sys/kern/kern_time.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 2d53d3fb892d..aaa389054c23 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -293,24 +293,19 @@ nanosleep(struct thread *td, struct nanosleep_args *uap)
if (error)
return (error);
+ if (uap->rmtp &&
+ !useracc((caddr_t)uap->rmtp, sizeof(rmt), VM_PROT_WRITE))
+ return (EFAULT);
mtx_lock(&Giant);
- if (uap->rmtp) {
- if (!useracc((caddr_t)uap->rmtp, sizeof(rmt),
- VM_PROT_WRITE)) {
- error = EFAULT;
- goto done2;
- }
- }
error = nanosleep1(td, &rqt, &rmt);
+ mtx_unlock(&Giant);
if (error && uap->rmtp) {
int error2;
error2 = copyout(&rmt, uap->rmtp, sizeof(rmt));
- if (error2) /* XXX shouldn't happen, did useracc() above */
+ if (error2)
error = error2;
}
-done2:
- mtx_unlock(&Giant);
return (error);
}