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/i386 | |
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/i386')
-rw-r--r-- | sys/i386/i386/swapgeneric.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/i386/i386/swapgeneric.c b/sys/i386/i386/swapgeneric.c index 5575e62..7cc6e4b 100644 --- a/sys/i386/i386/swapgeneric.c +++ b/sys/i386/i386/swapgeneric.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91 - * $Id: swapgeneric.c,v 1.23 1998/02/20 13:37:37 bde Exp $ + * $Id: swapgeneric.c,v 1.24 1998/09/15 10:03:43 gibbs Exp $ */ #include <sys/param.h> @@ -138,7 +138,8 @@ bad: unit = 0; for (gc = genericconf; gc->gc_name; gc++) { for (bd = 0; bd < nblkdev; bd++) { - if (!strcmp(bdevsw[bd]->d_name, gc->gc_name)) { + if (bdevsw[bd] != NULL && + strcmp(bdevsw[bd]->d_name, gc->gc_name) == 0) { printf("root on %s0\n", bdevsw[bd]->d_name); goto found; } |