summaryrefslogtreecommitdiffstats
path: root/EdkModulePkg
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-05 05:20:37 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-05 05:20:37 +0000
commitd97430c57a781ec26d272af0598d47d47f85d96f (patch)
tree42b6fa0d11e11e92080b2a0edecea723ce817ef5 /EdkModulePkg
parent1650d76a3febcd1316768c3fc270ae0c07bccf74 (diff)
downloadedk2-d97430c57a781ec26d272af0598d47d47f85d96f.tar.gz
edk2-d97430c57a781ec26d272af0598d47d47f85d96f.tar.bz2
edk2-d97430c57a781ec26d272af0598d47d47f85d96f.zip
1. Merger Tracker 8448: PciHostBridgeEnumerator() error checking could lead to memory leak
2. Merger Tracker 8450: AllRootHPCInitialized() passed in timeout value incorrect git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2629 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.c13
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.h15
-rw-r--r--EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c7
3 files changed, 13 insertions, 22 deletions
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.c
index 8707487311..7fba0476b5 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -21,7 +21,7 @@ Revision History
--*/
-#include "pcibus.h"
+#include "Pcibus.h"
#include "PciHotPlugSupport.h"
EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit;
@@ -270,17 +270,18 @@ Returns:
EFI_STATUS
AllRootHPCInitialized (
- IN UINTN TimeoutInMilliSeconds
+ IN UINTN TimeoutInMicroSeconds
)
/*++
Routine Description:
Arguments:
+ TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization
Returns:
-
- None
+ EFI_SUCCESS - All root hpc's initialization is finished before the timeout
+ EFI_TIMEOUT - Time out
--*/
// TODO: TimeoutInMilliSeconds - add argument and description to function comment
@@ -290,7 +291,7 @@ Returns:
UINT32 Delay;
UINTN Index;
- Delay = (UINT32) (((TimeoutInMilliSeconds * STALL_1_MILLI_SECOND) / 30) + 1);
+ Delay = (UINT32) ((TimeoutInMicroSeconds / 30) + 1);
do {
for (Index = 0; Index < gPciRootHpcCount; Index++) {
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.h b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.h
index df49ebaf56..7b15a3cd37 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.h
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciHotPlugSupport.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,10 +24,6 @@ Revision History
#ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H
#define _EFI_PCI_HOT_PLUG_SUPPORT_H
-//
-// stall 1 ms
-//
-#define STALL_1_MILLI_SECOND 1000
//
// stall 1 second
@@ -205,7 +201,7 @@ Returns:
EFI_STATUS
AllRootHPCInitialized (
- IN UINTN TimeoutInMilliSeconds
+ IN UINTN TimeoutInMicroSeconds
)
/*++
@@ -214,12 +210,11 @@ Routine Description:
TODO: Add function description
Arguments:
-
- TimeoutInMilliSeconds - TODO: add argument description
+ TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization
Returns:
-
- TODO: add return values
+ EFI_SUCCESS - All root hpc's initialization is finished before the timeout
+ EFI_TIMEOUT - Time out
--*/
;
diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
index 1601a4d617..eaeca2ad4f 100644
--- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
+++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c
@@ -1881,15 +1881,10 @@ Returns:
RootBridgeDev
);
+ DestroyRootBridge (RootBridgeDev);
if (EFI_ERROR (Status)) {
return Status;
}
-
- DestroyRootBridge (RootBridgeDev);
-
- //
- // Error proccess here
- //
}
//