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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index c09f5f3..52075e4 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1784,7 +1784,7 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
ktrsysctl(name, namelen);
#endif
- if (req.oldlen > PAGE_SIZE) {
+ if (req.oldptr && req.oldlen > PAGE_SIZE) {
memlocked = 1;
sx_xlock(&sysctlmemlock);
} else
OpenPOWER on IntegriCloud