From 35c052e4d0a3897776c875bfa2a201eece0ef6a6 Mon Sep 17 00:00:00 2001 From: Niklas Hallqvist Date: Wed, 21 Jan 1998 12:23:46 +0000 Subject: Prevent a NULL-deref in the autoconf_verbose case --- sys/kern/subr_autoconf.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index fa8751e8eee..13c6e0f6fcc 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_autoconf.c,v 1.18 1998/01/20 20:12:11 niklas Exp $ */ +/* $OpenBSD: subr_autoconf.c,v 1.19 1998/01/21 12:23:45 niklas Exp $ */ /* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */ /* @@ -201,9 +201,12 @@ config_search(fn, parent, aux) } } if (autoconf_verbose) - printf(">>> probe for %s%d won\n", - ((struct cfdata *)m.match)->cf_driver->cd_name, - ((struct cfdata *)m.match)->cf_unit); + if (m.match) + printf(">>> probe for %s%d won\n", + ((struct cfdata *)m.match)->cf_driver->cd_name, + ((struct cfdata *)m.match)->cf_unit); + else + printf(">>> no winning probe\n"); return (m.match); } -- cgit v1.2.3