From 03fe27a77383de96ee608557018620836fe5cb12 Mon Sep 17 00:00:00 2001 From: mjg Date: Wed, 21 Jan 2015 01:06:14 +0000 Subject: [PATCH] filedesc: plug a test for impossible condition in _fget --- sys/kern/kern_descrip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 82ce56ddcaf3..4b4af296769a 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2439,8 +2439,7 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags, int error; *fpp = NULL; - if (td == NULL || (fdp = td->td_proc->p_fd) == NULL) - return (EBADF); + fdp = td->td_proc->p_fd; if (needrightsp != NULL) needrights = *needrightsp; else