1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

Fix for a potential bug caught by Coverity. Pointed out to me by Kris Kennaway.

This commit is contained in:
Mohan Srinivasan 2006-09-14 17:57:02 +00:00
parent 7410947271
commit 3c5b80d6c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162310

View File

@ -306,7 +306,8 @@ namei(struct nameidata *ndp)
static int
compute_cn_lkflags(struct mount *mp, int lkflags)
{
if ((lkflags & LK_SHARED) && !(mp->mnt_kern_flag & MNTK_LOOKUP_SHARED)) {
if (mp == NULL ||
((lkflags & LK_SHARED) && !(mp->mnt_kern_flag & MNTK_LOOKUP_SHARED))) {
lkflags &= ~LK_SHARED;
lkflags |= LK_EXCLUSIVE;
}