diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_descrip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 2c8955c4d01..93d6a9c4cfe 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_descrip.c,v 1.118 2015/04/30 09:20:51 mpi Exp $ */ +/* $OpenBSD: kern_descrip.c,v 1.119 2015/04/30 21:18:45 millert Exp $ */ /* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */ /* @@ -201,7 +201,7 @@ fd_getfile_mode(struct filedesc *fdp, int fd, int mode) fp = fd_getfile(fdp, fd); - if ((fp->f_flag & mode) == 0) + if (fp == NULL || (fp->f_flag & mode) == 0) return (NULL); return (fp); |