Module Name:    src
Committed By:   jakllsch
Date:           Sun Apr 10 15:02:01 UTC 2011

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

Log Message:
Fix regression introduced in 1.72.
(Attach arguments need to be copied before using the copy.)


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/viaide.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/viaide.c
diff -u src/sys/dev/pci/viaide.c:1.72 src/sys/dev/pci/viaide.c:1.73
--- src/sys/dev/pci/viaide.c:1.72	Mon Apr  4 20:37:56 2011
+++ src/sys/dev/pci/viaide.c	Sun Apr 10 15:02:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: viaide.c,v 1.72 2011/04/04 20:37:56 dyoung Exp $	*/
+/*	$NetBSD: viaide.c,v 1.73 2011/04/10 15:02:01 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viaide.c,v 1.72 2011/04/04 20:37:56 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viaide.c,v 1.73 2011/04/10 15:02:01 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -914,11 +914,14 @@
 	struct pciide_channel *cp;
 	struct ata_channel *wdc_cp;
 	struct wdc_regs *wdr;
-	struct pci_attach_args pacopy, *pa = &pacopy;
-	pcireg_t interface = PCI_INTERFACE(pa->pa_class);
+	struct pci_attach_args pacopy, *pa;
+	pcireg_t interface;
 	int channel;
 
 	pacopy = *pa0;
+	pa = &pacopy;
+	interface = PCI_INTERFACE(pa->pa_class);
+
 	if (via_sata_chip_map_common(sc, pa) == 0)
 		return;
 
@@ -986,14 +989,17 @@
 	struct pciide_channel *cp;
 	struct ata_channel *wdc_cp;
 	struct wdc_regs *wdr;
-	struct pci_attach_args pacopy, *pa = &pacopy;
-	pcireg_t interface = PCI_INTERFACE(pa->pa_class);
+	struct pci_attach_args pacopy, *pa;
+	pcireg_t interface;
 	int channel;
 	pci_intr_handle_t intrhandle;
 	const char *intrstr;
 	int i;
 
 	pacopy = *pa0;
+	pa = &pacopy;
+	interface = PCI_INTERFACE(pa->pa_class);
+
 	if (via_sata_chip_map_common(sc, pa) == 0)
 		return;
 

Reply via email to