diff options
author | msmith <msmith@FreeBSD.org> | 1998-03-09 08:10:21 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-03-09 08:10:21 +0000 |
commit | f6b43acab69e713e88c5ec2a41b2ebc74a4eca99 (patch) | |
tree | 3a2d93b1a9a492c6d6c64be8c8c66e5d35bf00d2 /sys/amd64 | |
parent | d51b6829b75d663fe3bca551a9f266c9a75d37d1 (diff) | |
download | FreeBSD-src-f6b43acab69e713e88c5ec2a41b2ebc74a4eca99.zip FreeBSD-src-f6b43acab69e713e88c5ec2a41b2ebc74a4eca99.tar.gz |
Merge from 2.2; behave correctly in the presence of a slice number that
doesn't directly correspond to the slice field in the device minor number.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index c520e5b..665ddc9 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 - * $Id: autoconf.c,v 1.85 1998/01/30 11:32:39 phk Exp $ + * $Id: autoconf.c,v 1.86 1998/03/08 15:06:55 msmith Exp $ */ /* @@ -55,6 +55,7 @@ #include <sys/systm.h> #include <sys/conf.h> #include <sys/disklabel.h> +#include <sys/diskslice.h> /* for BASE_SLICE, MAX_SLICES */ #include <sys/reboot.h> #include <sys/kernel.h> #include <sys/mount.h> @@ -454,6 +455,8 @@ setroot() adaptor = B_ADAPTOR(bootdev); unit = B_UNIT(bootdev); slice = B_SLICE(bootdev); + if ((slice < BASE_SLICE) || (slice > MAX_SLICES)) + slice = 0; if (majdev > sizeof(devname) / sizeof(devname[0])) return; if (majdev == FDMAJOR) { |