In revoke(), verify that VCHR vnode indeed belongs to devfs.

Found and tested by:	pho
MFC after:	1 week
This commit is contained in:
kib 2010-07-06 18:20:49 +00:00
parent 456af86363
commit 15d16124c2

View File

@ -4215,7 +4215,7 @@ revoke(td, uap)
vfslocked = NDHASGIANT(&nd);
vp = nd.ni_vp;
NDFREE(&nd, NDF_ONLY_PNBUF);
if (vp->v_type != VCHR) {
if (vp->v_type != VCHR || vp->v_rdev == NULL) {
error = EINVAL;
goto out;
}