diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2007-06-01 22:23:04 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2007-06-01 22:23:04 +0000 |
commit | 88154fd1fd69bfb65f6e9bd703776f1fc823dac7 (patch) | |
tree | ad9a54be0daa23eed6e138f1bc05b0747de4c688 /sys/dev | |
parent | 5ef404469dbc63565727dbeb8d0bfa57e7f29b0e (diff) |
check return value of findblkmajor; this fixes a crash on vax during boot.
add check for failed geteblk.
exclude rx during boot probe.
help miod todd
ok todd
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/softraid.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index ff02511943f..75d77323610 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.67 2007/06/01 18:50:56 marco Exp $ */ +/* $OpenBSD: softraid.c,v 1.68 2007/06/01 22:23:03 marco Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * @@ -2417,18 +2417,24 @@ sr_boot_assembly(struct sr_softc *sc) SLIST_INIT(&mlh); bp = geteblk(sz); + if (!bp) + return (ENOMEM); TAILQ_FOREACH(dv, &alldevs, dv_list) { if (dv->dv_class != DV_DISK) continue; majdev = findblkmajor(dv); + if (majdev == -1) + continue; + bp->b_dev = dev = MAKEDISKDEV(majdev, dv->dv_unit, RAW_PART); bdsw = &bdevsw[major(dev)]; /* XXX is there a better way of excluding some devices? */ if (!strncmp(dv->dv_xname, "fd", 2) || - !strncmp(dv->dv_xname, "cd", 2)) + !strncmp(dv->dv_xname, "cd", 2) || + !strncmp(dv->dv_xname, "rx", 2)) continue; /* open device */ |