From c322fa140e8f5fa85c56cbd95e436c6a2a233c82 Mon Sep 17 00:00:00 2001 From: KATO Takenori Date: Thu, 2 Sep 1999 15:01:56 +0000 Subject: [PATCH] The ed_probe_Novell should not clear id_maddr when it fails to probe. This fixes potential panic by kvtop at addr == 0. Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata) --- sys/dev/ed/if_ed.c | 8 ++++++-- sys/i386/isa/if_ed.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index fed261abfe59..f9c83e07f265 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1282,10 +1282,14 @@ ed_probe_Novell(isa_dev) struct isa_device *isa_dev; { struct ed_softc *sc = &ed_softc[isa_dev->id_unit]; + int nports; - isa_dev->id_maddr = 0; - return ed_probe_Novell_generic(sc, isa_dev->id_iobase, + nports = ed_probe_Novell_generic(sc, isa_dev->id_iobase, isa_dev->id_unit, isa_dev->id_flags); + if (nports) + isa_dev->id_maddr = 0; + + return (nports); } #if NCARD > 0 diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c index fed261abfe59..f9c83e07f265 100644 --- a/sys/i386/isa/if_ed.c +++ b/sys/i386/isa/if_ed.c @@ -1282,10 +1282,14 @@ ed_probe_Novell(isa_dev) struct isa_device *isa_dev; { struct ed_softc *sc = &ed_softc[isa_dev->id_unit]; + int nports; - isa_dev->id_maddr = 0; - return ed_probe_Novell_generic(sc, isa_dev->id_iobase, + nports = ed_probe_Novell_generic(sc, isa_dev->id_iobase, isa_dev->id_unit, isa_dev->id_flags); + if (nports) + isa_dev->id_maddr = 0; + + return (nports); } #if NCARD > 0