diff options
| author | manu <manu@NetBSD.org> | 2002-03-01 22:58:33 +0000 |
|---|---|---|
| committer | manu <manu@NetBSD.org> | 2002-03-01 22:58:33 +0000 |
| commit | f48c7db878a0ea185e7cdcb8e0183ee4b92c5cd1 (patch) | |
| tree | 93593f831af17073468fbc524874a758e61dfab4 /sys/dev/clockctl.c | |
| parent | 1caa35aa0f5d139a90b3daf880d091773b512845 (diff) | |
Two more trivial bug fixes:
- copyin() the ntv argument to ntp_adjtime1(), to avoid some panics
- correctly handle the return value
And this still relates to kern/15519
Diffstat (limited to 'sys/dev/clockctl.c')
| -rw-r--r-- | sys/dev/clockctl.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/clockctl.c b/sys/dev/clockctl.c index 8e218825054..f27171990b0 100644 --- a/sys/dev/clockctl.c +++ b/sys/dev/clockctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: clockctl.c,v 1.5 2002/02/25 21:16:36 manu Exp $ */ +/* $NetBSD: clockctl.c,v 1.6 2002/03/01 22:58:33 manu Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.5 2002/02/25 21:16:36 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.6 2002/03/01 22:58:33 manu Exp $"); #include "opt_ntp.h" @@ -126,9 +126,16 @@ clockctlioctl(dev, cmd, data, flags, p) case CLOCKCTL_NTP_ADJTIME: { struct clockctl_ntp_adjtime_args *args = (struct clockctl_ntp_adjtime_args *)data; + struct timex ntv; - (void)ntp_adjtime1(SCARG(args,uas.tp), args, &error); - return (error); + error = copyin((caddr_t)SCARG(args,uas.tp), + (caddr_t)&ntv, sizeof(ntv)); + if (error) + return (error); + + error = ntp_adjtime1(&ntv, args, &args->retval); + return (error); + break; } #endif /* NTP */ default: |
