diff options
author | bde <bde@FreeBSD.org> | 1998-10-25 19:26:18 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-10-25 19:26:18 +0000 |
commit | 558766fa9415f59d49437a086cc1260d95828a0b (patch) | |
tree | 05be5c55f69047b10ab0de43bf5c0ef6624703eb /sys/isofs | |
parent | 9fafc4765300a0de262e82faff274b179b1c3772 (diff) | |
download | FreeBSD-src-558766fa9415f59d49437a086cc1260d95828a0b.zip FreeBSD-src-558766fa9415f59d49437a086cc1260d95828a0b.tar.gz |
Don't follow null bdevsw pointers. The `major(dev) < nblkdev' test rotted
when bdevsw[] became sparse. We still depend on magic to avoid having to
check that (v_rdev) device numbers in vnodes are not NODEV.
Diffstat (limited to 'sys/isofs')
-rw-r--r-- | sys/isofs/cd9660/cd9660_vfsops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index fb877ca..69e3ebd 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 - * $Id: cd9660_vfsops.c,v 1.43 1998/09/07 13:17:00 bde Exp $ + * $Id: cd9660_vfsops.c,v 1.44 1998/09/14 19:56:39 sos Exp $ */ #include <sys/param.h> @@ -229,7 +229,8 @@ cd9660_mount(mp, path, data, ndp, p) vrele(devvp); return ENOTBLK; } - if (major(devvp->v_rdev) >= nblkdev) { + if (major(devvp->v_rdev) >= nblkdev || + bdevsw[major(devvp->v_rdev)] == NULL) { vrele(devvp); return ENXIO; } |