From 558766fa9415f59d49437a086cc1260d95828a0b Mon Sep 17 00:00:00 2001 From: bde Date: Sun, 25 Oct 1998 19:26:18 +0000 Subject: 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. --- sys/msdosfs/msdosfs_vfsops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/msdosfs') diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index 42798d7..cf8f905 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $Id: msdosfs_vfsops.c,v 1.35 1998/05/06 05:29:38 msmith Exp $ */ +/* $Id: msdosfs_vfsops.c,v 1.36 1998/09/07 13:17:02 bde Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -297,7 +298,8 @@ msdosfs_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); } -- cgit v1.1