summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 35dc3dc..e56c481 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1371,8 +1371,11 @@ __sysctl(struct thread *td, struct sysctl_args *uap)
uap->new, uap->newlen, &j, 0);
if (error && error != ENOMEM)
return (error);
- if (uap->oldlenp)
- error = copyout(&j, uap->oldlenp, sizeof(j));
+ if (uap->oldlenp) {
+ int i = copyout(&j, uap->oldlenp, sizeof(j));
+ if (i)
+ return (i);
+ }
return (error);
}
OpenPOWER on IntegriCloud