From d97430c57a781ec26d272af0598d47d47f85d96f Mon Sep 17 00:00:00 2001 From: vanjeff Date: Tue, 5 Jun 2007 05:20:37 +0000 Subject: [PATCH] 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 --- .../Bus/Pci/PciBus/Dxe/PciHotPlugSupport.c | 13 +++++++------ .../Bus/Pci/PciBus/Dxe/PciHotPlugSupport.h | 15 +++++---------- EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c | 7 +------ 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 - // } // -- 2.39.2