changeset 3117:93b86481091a onnv_53

6487609 vgatext_get_pci_reg_index failing to find a reg entry leads to panic in i915_sun_attach
author kz151634
date Mon, 13 Nov 2006 22:04:21 -0800
parents e4293e8671d8
children 7f60028f32a1
files usr/src/uts/i86pc/io/drm/i915_sundrv.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/i86pc/io/drm/i915_sundrv.c	Mon Nov 13 22:02:07 2006 -0800
+++ b/usr/src/uts/i86pc/io/drm/i915_sundrv.c	Mon Nov 13 22:04:21 2006 -0800
@@ -341,12 +341,14 @@
 		if (softc->agp_master != NULL)
 			agpmaster_detach(&softc->agp_master);
 
-		/* free PCI config access handle */
-		pci_config_teardown(softc->pci_cfg_hdlp);
+		if (softc->pci_cfg_hdlp) {
+			/* free PCI config access handle */
+			pci_config_teardown(softc->pci_cfg_hdlp);
 
-		/* free PCI configuration handle */
-		kmem_free((void *)softc->pci_cfg_hdlp,
-		    (sizeof (ddi_acc_handle_t)));
+			/* free PCI configuration handle */
+			kmem_free((void *)softc->pci_cfg_hdlp,
+			    (sizeof (ddi_acc_handle_t)));
+		}
 
 		/* graphics misc module detach */
 		(void) gfxp_vgatext_detach(devi, DDI_DETACH, softc->ds_gfx);