summaryrefslogtreecommitdiffstats
path: root/sys/msdosfs
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-10-25 19:26:18 +0000
committerbde <bde@FreeBSD.org>1998-10-25 19:26:18 +0000
commit558766fa9415f59d49437a086cc1260d95828a0b (patch)
tree05be5c55f69047b10ab0de43bf5c0ef6624703eb /sys/msdosfs
parent9fafc4765300a0de262e82faff274b179b1c3772 (diff)
downloadFreeBSD-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/msdosfs')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c6
1 files changed, 4 insertions, 2 deletions
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 <sys/param.h>
#include <sys/systm.h>
+#include <sys/conf.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/kernel.h>
@@ -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);
}
OpenPOWER on IntegriCloud