In nfs_down(), if rep can be NULL, which we test for, then we should

lock and unlock conditionally, not just set the flag on it conditionally.
In practice, this bug couldn't manifest, as in the current revision of
the code, no callers pass a NULL rep.

CID:		1416
Found with:	Coverity Prevent(tm)
This commit is contained in:
Robert Watson 2007-05-18 19:34:54 +00:00
parent 355799f41f
commit 5d0dd109f4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169681

View File

@ -1888,10 +1888,11 @@ nfs_down(rep, nmp, td, msg, error, flags)
} else
mtx_unlock(&nmp->nm_mtx);
#endif
mtx_lock(&rep->r_mtx);
if (rep)
if (rep != NULL) {
mtx_lock(&rep->r_mtx);
rep->r_flags |= R_TPRINTFMSG;
mtx_unlock(&rep->r_mtx);
mtx_unlock(&rep->r_mtx);
}
nfs_msg(td, nmp->nm_mountp->mnt_stat.f_mntfromname, msg, error);
}