diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-08-03 17:49:05 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-08-03 17:49:05 +0000 |
commit | d939319245dde5fb5757f12b3fa4b835e3d88219 (patch) | |
tree | 270b617f07f4952c3f9e9ee60c69b7d22030e52e | |
parent | b8ed71e1dd36fa802eca4f3384c7c7ab410abea5 (diff) |
Fix a minor bug where indirect config crashes the kernel
when match verbose is turend on.
-rw-r--r-- | sys/kern/subr_autoconf.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index a5795091672..c378eac10e2 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_autoconf.c,v 1.37 2004/05/30 08:11:26 grange Exp $ */ +/* $OpenBSD: subr_autoconf.c,v 1.38 2004/08/03 17:49:04 pefo Exp $ */ /* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */ /* @@ -210,10 +210,14 @@ config_search(fn, parent, aux) } } if (autoconf_verbose) { - if (m.match) + if (m.match) { + if (m.indirect) + cf = ((struct device *)m.match)->dv_cfdata; + else + cf = (struct cfdata *)m.match; printf(">>> %s probe won\n", - ((struct cfdata *)m.match)->cf_driver->cd_name); - else + cf->cf_driver->cd_name); + } else printf(">>> no winning probe\n"); } return (m.match); |