Avoid dereferencing the thread pointer in smb_iod_addrq() if it's NULL.

Fixes mdconfig -t vnode on smbfs: mdsetcred()'s "horrible kludge"
calls into smbfs VOP_READ with a NULL uio_td.
This commit is contained in:
Tim J. Robbins 2003-06-14 15:45:34 +00:00
parent 35c5de54e8
commit 62ca80a7ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116339

View File

@ -401,7 +401,8 @@ smb_iod_addrq(struct smb_rq *rqp)
int error;
SMBIODEBUG("\n");
if (rqp->sr_cred->scr_td->td_proc == iod->iod_p) {
if (rqp->sr_cred->scr_td != NULL &&
rqp->sr_cred->scr_td->td_proc == iod->iod_p) {
rqp->sr_flags |= SMBR_INTERNAL;
SMB_IOD_RQLOCK(iod);
TAILQ_INSERT_HEAD(&iod->iod_rqlist, rqp, sr_link);