From 42e1d99cc8ab431dcb375eddec8fe101c6832642 Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Wed, 11 May 2005 19:08:38 +0000 Subject: [PATCH] Do not dereference dvp pointer before doing a NULL check. Noticed by: Coverity Prevent analysis tool. --- sys/fs/nwfs/nwfs_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/nwfs/nwfs_subr.c b/sys/fs/nwfs/nwfs_subr.c index 8a8e5dc1bd1..4a2c65ca6af 100644 --- a/sys/fs/nwfs/nwfs_subr.c +++ b/sys/fs/nwfs/nwfs_subr.c @@ -177,7 +177,7 @@ ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap, struct thread *td,struct ucred *cred) { struct nwmount *nmp; - struct nwnode *dnp = VTONW(dvp); + struct nwnode *dnp; struct ncp_conn *conn; int error; @@ -185,6 +185,7 @@ ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap, nwfs_printf("dvp is NULL or not a directory.\n"); return (ENOENT); } + dnp = VTONW(dvp); nmp = VTONWFS(dvp); conn = NWFSTOCONN(nmp);