From e2b3af9d2c2b78c059f57d215f1056ab5b88ce91 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 4 Apr 2006 14:18:35 +0000 Subject: [PATCH] Coverity CID 1140: NULL dereference cannot happen, but protect against it. --- sys/miscfs/fdesc/fdesc_vnops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index ca48642d3d14..04dfef42b87c 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdesc_vnops.c,v 1.90 2006/03/01 12:38:21 yamt Exp $ */ +/* $NetBSD: fdesc_vnops.c,v 1.91 2006/04/04 14:18:35 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.90 2006/03/01 12:38:21 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.91 2006/04/04 14:18:35 christos Exp $"); #include #include @@ -786,7 +786,7 @@ fdesc_readdir(v) default: KASSERT(fdp != NULL); j = (int)i - 2; - if (fdp->fd_ofiles[j] == NULL || + if (fdp == NULL || fdp->fd_ofiles[j] == NULL || FILE_IS_USABLE(fdp->fd_ofiles[j]) == 0) continue; d.d_fileno = j + FD_STDIN;