Module Name:    src
Committed By:   phx
Date:           Fri Dec 10 21:20:09 UTC 2010

Modified Files:
        src/sys/dev/pci: viaenv.c

Log Message:
Initialize sc_iot early enough to avoid a crash when the hardware monitor
function was found disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/viaenv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/viaenv.c
diff -u src/sys/dev/pci/viaenv.c:1.29 src/sys/dev/pci/viaenv.c:1.30
--- src/sys/dev/pci/viaenv.c:1.29	Wed Apr 30 14:07:14 2008
+++ src/sys/dev/pci/viaenv.c	Fri Dec 10 21:20:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: viaenv.c,v 1.29 2008/04/30 14:07:14 ad Exp $	*/
+/*	$NetBSD: viaenv.c,v 1.30 2010/12/10 21:20:09 phx Exp $	*/
 
 /*
  * Copyright (c) 2000 Johan Danielsson
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.29 2008/04/30 14:07:14 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viaenv.c,v 1.30 2010/12/10 21:20:09 phx Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -295,6 +295,8 @@
 		break;
 	}
 
+	sc->sc_iot = pa->pa_iot;
+
 	iobase = pci_conf_read(pa->pa_pc, pa->pa_tag, VIAENV_HWMON_CONF);
 	DPRINTF(("%s: iobase 0x%x\n", device_xname(self), iobase));
 	control = pci_conf_read(pa->pa_pc, pa->pa_tag, VIAENV_HWMON_CTL);
@@ -306,7 +308,6 @@
 	}
 
 	/* Map Hardware Monitor I/O space */
-	sc->sc_iot = pa->pa_iot;
 	if (bus_space_map(sc->sc_iot, iobase & 0xff80,
 	    VIAENV_PMSIZE, 0, &sc->sc_ioh)) {
 		aprint_error_dev(self, "failed to map I/O space\n");

Reply via email to