From 4eea61af117f31587a2ae4d29e0b3a8043445d13 Mon Sep 17 00:00:00 2001 From: ragge Date: Fri, 26 May 2000 21:05:01 +0000 Subject: [PATCH] If we panic before the vsbus is found, don't panic again. --- sys/arch/vax/vsa/vsbus.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/arch/vax/vsa/vsbus.c b/sys/arch/vax/vsa/vsbus.c index 238349909c9a..dc3480f15557 100644 --- a/sys/arch/vax/vsa/vsbus.c +++ b/sys/arch/vax/vsa/vsbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: vsbus.c,v 1.24 2000/04/23 16:38:54 matt Exp $ */ +/* $NetBSD: vsbus.c,v 1.25 2000/05/26 21:05:01 ragge Exp $ */ /* * Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -248,9 +248,13 @@ unsigned char vsbus_setmask(mask) unsigned char mask; { - struct vsbus_softc *sc = vsbus_cd.cd_devs[0]; + struct vsbus_softc *sc; unsigned char ch; + if (vsbus_cd.cd_ndevs == 0) + return 0; + sc = vsbus_cd.cd_devs[0]; + ch = *sc->sc_intmsk; *sc->sc_intmsk = mask; return ch; @@ -263,7 +267,11 @@ void vsbus_clrintr(mask) unsigned char mask; { - struct vsbus_softc *sc = vsbus_cd.cd_devs[0]; + struct vsbus_softc *sc; + + if (vsbus_cd.cd_ndevs == 0) + return; + sc = vsbus_cd.cd_devs[0]; *sc->sc_intclr = mask; }