changeset 4005:7f159f75c1e1

6542632 memory leak in pcie module
author krishnae
date Tue, 10 Apr 2007 13:53:12 -0700
parents 027a924f9ee3
children ae098b2a8faa
files usr/src/uts/sun4/io/px/px.c usr/src/uts/sun4/io/px/px_pci.c usr/src/uts/sun4u/io/pci/pci_pci.c
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/sun4/io/px/px.c	Tue Apr 10 12:46:10 2007 -0700
+++ b/usr/src/uts/sun4/io/px/px.c	Tue Apr 10 13:53:12 2007 -0700
@@ -1255,7 +1255,8 @@
 			if (as->cmd == DDI_ATTACH && as->result != DDI_SUCCESS)
 				pcie_pm_release(dip);
 
-			pf_init(rdip, (void *)px_p->px_fm_ibc, as->cmd);
+			if (as->result == DDI_SUCCESS)
+				pf_init(rdip, (void *)px_p->px_fm_ibc, as->cmd);
 
 			(void) pcie_postattach_child(rdip);
 
--- a/usr/src/uts/sun4/io/px/px_pci.c	Tue Apr 10 12:46:10 2007 -0700
+++ b/usr/src/uts/sun4/io/px/px_pci.c	Tue Apr 10 13:53:12 2007 -0700
@@ -701,7 +701,9 @@
 			if (as->cmd == DDI_ATTACH && as->result != DDI_SUCCESS)
 				pcie_pm_release(dip);
 
-			pf_init(rdip, (void *)pxb_p->pxb_fm_ibc, as->cmd);
+			if (as->result == DDI_SUCCESS)
+				pf_init(rdip, (void *)pxb_p->pxb_fm_ibc,
+				    as->cmd);
 
 			/*
 			 * For hotplug-capable slots, we should explicitly
--- a/usr/src/uts/sun4u/io/pci/pci_pci.c	Tue Apr 10 12:46:10 2007 -0700
+++ b/usr/src/uts/sun4u/io/pci/pci_pci.c	Tue Apr 10 13:53:12 2007 -0700
@@ -578,7 +578,7 @@
 
 		as = (struct attachspec *)arg;
 		if ((ppb_p->parent_bus == PCIE_PCIECAP_DEV_TYPE_PCIE_DEV) &&
-		    (as->when == DDI_POST))
+		    (as->when == DDI_POST) && (as->result == DDI_SUCCESS))
 			pf_init(rdip, ppb_p->fm_ibc, as->cmd);
 
 		return (DDI_SUCCESS);