diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 791239d85818..34b7cf066b26 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2583,6 +2583,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) return (error); } fdp = fdhold(p); + if (fdp == NULL) + return (0); PROC_UNLOCK(p); kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); FILEDESC_SLOCK(fdp);