From: Ben Kaduk Date: Sat, 15 May 2010 21:11:15 +0000 (-0400) Subject: Do not try to increase the refcount of a NULL vnode X-Git-Tag: openafs-devel-1_5_75~281 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=0f36d82e896b7f3783ef11ec4196e5009aee162a;p=packages%2Fo%2Fopenafs.git Do not try to increase the refcount of a NULL vnode osi_lookup is not guaranteed to give us a valid vnode, so check before calling VN_HOLD(). Change-Id: I3d2a4d441f6991c08beccb6b10a428f5746db146 Reviewed-on: http://gerrit.openafs.org/1967 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index b17f4252d..0e170d959 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -1133,7 +1133,8 @@ afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, int follow) #else code = gop_lookupname_user(path, AFS_UIOUSER, follow, &vp); #if defined(AFS_FBSD80_ENV) /* XXX check on 7x */ - VN_HOLD(vp); + if (vp != NULL) + VN_HOLD(vp); #endif /* AFS_FBSD80_ENV */ #endif /* AFS_LINUX22_ENV */ #endif /* AFS_AIX41_ENV */