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

This commit is contained in:
mohans 2006-09-14 17:57:02 +00:00
parent 8ba1360ee0
commit a569229408

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;
}