diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 60360509caf8..039d0e1040c6 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -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); }