diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index ab9ce7f5a5b4..4fc055332056 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -148,6 +148,9 @@ spec_open(ap) if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_NODEV)) return (ENXIO); + if (dev == NODEV) + return (ENXIO); + dsw = devsw(dev); if (dsw == NULL || dsw->d_open == NULL) return (ENXIO);