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
This commit is contained in:
vanjeff
2007-06-05 05:20:37 +00:00
parent 1650d76a3f
commit d97430c57a
3 changed files with 13 additions and 22 deletions

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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" #include "PciHotPlugSupport.h"
EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit; EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit;
@ -270,17 +270,18 @@ Returns:
EFI_STATUS EFI_STATUS
AllRootHPCInitialized ( AllRootHPCInitialized (
IN UINTN TimeoutInMilliSeconds IN UINTN TimeoutInMicroSeconds
) )
/*++ /*++
Routine Description: Routine Description:
Arguments: Arguments:
TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization
Returns: Returns:
EFI_SUCCESS - All root hpc's initialization is finished before the timeout
None EFI_TIMEOUT - Time out
--*/ --*/
// TODO: TimeoutInMilliSeconds - add argument and description to function comment // TODO: TimeoutInMilliSeconds - add argument and description to function comment
@ -290,7 +291,7 @@ Returns:
UINT32 Delay; UINT32 Delay;
UINTN Index; UINTN Index;
Delay = (UINT32) (((TimeoutInMilliSeconds * STALL_1_MILLI_SECOND) / 30) + 1); Delay = (UINT32) ((TimeoutInMicroSeconds / 30) + 1);
do { do {
for (Index = 0; Index < gPciRootHpcCount; Index++) { for (Index = 0; Index < gPciRootHpcCount; Index++) {

View File

@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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 #ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H
#define _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 // stall 1 second
@ -205,7 +201,7 @@ Returns:
EFI_STATUS EFI_STATUS
AllRootHPCInitialized ( AllRootHPCInitialized (
IN UINTN TimeoutInMilliSeconds IN UINTN TimeoutInMicroSeconds
) )
/*++ /*++
@ -214,12 +210,11 @@ Routine Description:
TODO: Add function description TODO: Add function description
Arguments: Arguments:
TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization
TimeoutInMilliSeconds - TODO: add argument description
Returns: Returns:
EFI_SUCCESS - All root hpc's initialization is finished before the timeout
TODO: add return values EFI_TIMEOUT - Time out
--*/ --*/
; ;

View File

@ -1881,15 +1881,10 @@ Returns:
RootBridgeDev RootBridgeDev
); );
DestroyRootBridge (RootBridgeDev);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
DestroyRootBridge (RootBridgeDev);
//
// Error proccess here
//
} }
// //