diff options
author | kib <kib@FreeBSD.org> | 2010-03-03 21:59:45 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-03-03 21:59:45 +0000 |
commit | 8de24b5a4580fa473a06658b781fdc0b4e4e0498 (patch) | |
tree | e21c3d1a6ec583a76eb0c826c1466009efbf436c /sys/fs/msdosfs | |
parent | b6d8a9837e6da5013dcd38683ceece26d89bb7fa (diff) | |
download | FreeBSD-src-8de24b5a4580fa473a06658b781fdc0b4e4e0498.zip FreeBSD-src-8de24b5a4580fa473a06658b781fdc0b4e4e0498.tar.gz |
When returning error from msdosfs_lookup(), make sure that *vpp is NULL.
lookup() KASSERTs this condition.
Reported and tested by: pho
MFC after: 3 weeks
Diffstat (limited to 'sys/fs/msdosfs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_lookup.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index ce5048a..999125d 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -125,14 +125,14 @@ msdosfs_lookup_(struct vnode *vdp, struct vnode **vpp, #endif dp = VTODE(vdp); pmp = dp->de_pmp; - if (vpp != NULL) - *vpp = NULL; #ifdef MSDOSFS_DEBUG printf("msdosfs_lookup(): vdp %p, dp %p, Attr %02x\n", vdp, dp, dp->de_Attributes); #endif restart: + if (vpp != NULL) + *vpp = NULL; /* * If they are going after the . or .. entry in the root directory, * they won't find it. DOS filesystems don't have them in the root @@ -525,8 +525,10 @@ foundroot: pdp = vdp; if (flags & ISDOTDOT) { error = msdosfs_deget_dotdot(pdp, cluster, blkoff, vpp); - if (error) + if (error) { + *vpp = NULL; return (error); + } /* * Recheck that ".." still points to the inode we * looked up before pdp lock was dropped. @@ -534,6 +536,7 @@ foundroot: error = msdosfs_lookup_(pdp, NULL, cnp, &inode1); if (error) { vput(*vpp); + *vpp = NULL; return (error); } if (VTODE(*vpp)->de_inode != inode1) { |