diff options
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand.h | 6 | ||||
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/DriverSupport.c | 7 | ||||
-rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/Notify.c | 33 |
3 files changed, 29 insertions, 17 deletions
diff --git a/MdeModulePkg/Core/Dxe/Hand.h b/MdeModulePkg/Core/Dxe/Hand.h index 8be7e58..b73bad9 100644 --- a/MdeModulePkg/Core/Dxe/Hand.h +++ b/MdeModulePkg/Core/Dxe/Hand.h @@ -41,7 +41,7 @@ typedef struct { #define PROTOCOL_ENTRY_SIGNATURE EFI_SIGNATURE_32('p','r','t','e')
typedef struct {
UINTN Signature;
- LIST_ENTRY AllEntries; // All entries
+ LIST_ENTRY AllEntries; // Link Entry inserted to mProtocolDatabase
EFI_GUID ProtocolID; // ID of the protocol
LIST_ENTRY Protocols; // All protocol interfaces
LIST_ENTRY Notify; // Registerd notification handlers
@@ -55,8 +55,8 @@ typedef struct { #define PROTOCOL_INTERFACE_SIGNATURE EFI_SIGNATURE_32('p','i','f','c')
typedef struct {
UINTN Signature;
- IHANDLE *Handle; // Back pointer
LIST_ENTRY Link; // Link on IHANDLE.Protocols
+ IHANDLE *Handle; // Back pointer
LIST_ENTRY ByProtocol; // Link on PROTOCOL_ENTRY.Protocols
PROTOCOL_ENTRY *Protocol; // The protocol ID
VOID *Interface; // The interface value
@@ -70,7 +70,7 @@ typedef struct { typedef struct {
UINTN Signature;
- LIST_ENTRY Link;
+ LIST_ENTRY Link; //Link on PROTOCOL_INTERFACE.OpenList
EFI_HANDLE AgentHandle;
EFI_HANDLE ControllerHandle;
diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index 9db124c..829215b 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -73,6 +73,10 @@ CoreConnectController ( AlignedRemainingDevicePath = NULL;
if (RemainingDevicePath != NULL) {
AlignedRemainingDevicePath = DuplicateDevicePath (RemainingDevicePath);
+
+ if (AlignedRemainingDevicePath == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
}
//
@@ -138,6 +142,9 @@ CoreConnectController ( // Allocate a handle buffer for ControllerHandle's children
//
ChildHandleBuffer = AllocatePool (ChildHandleCount * sizeof(EFI_HANDLE));
+ if (ChildHandleBuffer == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
//
// Fill in a handle buffer with ControllerHandle's children
diff --git a/MdeModulePkg/Core/Dxe/Hand/Notify.c b/MdeModulePkg/Core/Dxe/Hand/Notify.c index 5f4ae19..407e3ff 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Notify.c +++ b/MdeModulePkg/Core/Dxe/Hand/Notify.c @@ -1,5 +1,5 @@ /** @file
- UEFI notify infrastructure
+ Support functions for UEFI protocol notification infrastructure.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -213,8 +213,8 @@ CoreReinstallProtocolInterface ( //
Prot = CoreFindProtocolInterface (UserHandle, Protocol, OldInterface);
if (Prot == NULL) {
- CoreReleaseProtocolLock ();
- return EFI_NOT_FOUND;
+ Status = EFI_NOT_FOUND;
+ goto Done;
}
//
@@ -228,8 +228,7 @@ CoreReinstallProtocolInterface ( //
// One or more drivers refused to release, so return the error
//
- CoreReleaseProtocolLock ();
- return Status;
+ goto Done;
}
//
@@ -238,8 +237,8 @@ CoreReinstallProtocolInterface ( Prot = CoreRemoveInterfaceFromProtocol (Handle, Protocol, OldInterface);
if (Prot == NULL) {
- CoreReleaseProtocolLock ();
- return EFI_NOT_FOUND;
+ Status = EFI_NOT_FOUND;
+ goto Done;
}
ProtEntry = Prot->Protocol;
@@ -265,12 +264,15 @@ CoreReinstallProtocolInterface ( // Release the lock and connect all drivers to UserHandle
//
CoreReleaseProtocolLock ();
- Status = CoreConnectController (
- UserHandle,
- NULL,
- NULL,
- TRUE
- );
+ //
+ // Return code is ignored on purpose.
+ //
+ CoreConnectController (
+ UserHandle,
+ NULL,
+ NULL,
+ TRUE
+ );
CoreAcquireProtocolLock ();
//
@@ -280,5 +282,8 @@ CoreReinstallProtocolInterface ( CoreReleaseProtocolLock ();
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+
+Done:
+ return Status;
}
|