diff options
author | julian <julian@FreeBSD.org> | 1995-12-14 18:26:55 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-12-14 18:26:55 +0000 |
commit | 5cc12677c1eda4e544e7b0c18169050713059213 (patch) | |
tree | 7d10ec28dc13f23978c6ffa1cc6a252281305a3b /sys/miscfs | |
parent | b2517fc8e0daf48d1eb19fc5bf74f9aad80461ae (diff) | |
download | FreeBSD-src-5cc12677c1eda4e544e7b0c18169050713059213.zip FreeBSD-src-5cc12677c1eda4e544e7b0c18169050713059213.tar.gz |
another case where cdevsw becoming a pointer makes it neccesary to
check if it's NULL
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 46634a5..c1ccf07 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)kernfs_vfsops.c 8.4 (Berkeley) 1/21/94 - * $Id: kernfs_vfsops.c,v 1.11 1995/12/11 09:24:32 phk Exp $ + * $Id: kernfs_vfsops.c,v 1.12 1995/12/13 15:13:28 julian Exp $ */ /* @@ -119,8 +119,12 @@ kernfs_init() printf("kernfs_init\n"); /* printed during system boot */ #endif + if (!bdevsw[bmaj]) { + panic("root dev has no bdevsw"); + } for (cmaj = 0; cmaj < nchrdev; cmaj++) { - if (cdevsw[cmaj]->d_open == bdevsw[bmaj]->d_open) { + if (cdevsw[cmaj] + && (cdevsw[cmaj]->d_open == bdevsw[bmaj]->d_open)) { dev_t cdev = makedev(cmaj, minor(rootdev)); error = cdevvp(cdev, &rrootvp); if (error == 0) |