* Correct a mis-merge that leaked the PROC_LOCK [1]

* Return ENOENT on error instead of 0 [2]

Submitted by: rdivacky [1], kib [2]
This commit is contained in:
Kris Kennaway 2008-04-26 13:16:55 +00:00
parent 3800322fe2
commit 5894445dad

View file

@ -2583,9 +2583,9 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS)
return (error);
}
fdp = fdhold(p);
if (fdp == NULL)
return (0);
PROC_UNLOCK(p);
if (fdp == NULL)
return (ENOENT);
kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK);
FILEDESC_SLOCK(fdp);
if (fdp->fd_cdir != NULL)