summaryrefslogtreecommitdiffstats
path: root/sys/fs/nwfs
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2005-05-11 19:08:38 +0000
committerkan <kan@FreeBSD.org>2005-05-11 19:08:38 +0000
commit3f8ab6c93f5dda9a1148e260ba3d95d784c37f45 (patch)
tree0b3801bdf1c02597841533612fece6542c870bf6 /sys/fs/nwfs
parent7faf2ba388b75118522b3ffbbe7bb81378f4bdfa (diff)
downloadFreeBSD-src-3f8ab6c93f5dda9a1148e260ba3d95d784c37f45.zip
FreeBSD-src-3f8ab6c93f5dda9a1148e260ba3d95d784c37f45.tar.gz
Do not dereference dvp pointer before doing a NULL check.
Noticed by: Coverity Prevent analysis tool.
Diffstat (limited to 'sys/fs/nwfs')
-rw-r--r--sys/fs/nwfs/nwfs_subr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/nwfs/nwfs_subr.c b/sys/fs/nwfs/nwfs_subr.c
index 8a8e5dc..4a2c65c 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);
OpenPOWER on IntegriCloud