#define PROTOCOL_ENTRY_SIGNATURE EFI_SIGNATURE_32('p','r','t','e')\r
typedef struct {\r
UINTN Signature;\r
- LIST_ENTRY AllEntries; // All entries\r
+ LIST_ENTRY AllEntries; // Link Entry inserted to mProtocolDatabase\r
EFI_GUID ProtocolID; // ID of the protocol\r
LIST_ENTRY Protocols; // All protocol interfaces\r
LIST_ENTRY Notify; // Registerd notification handlers\r
#define PROTOCOL_INTERFACE_SIGNATURE EFI_SIGNATURE_32('p','i','f','c')\r
typedef struct {\r
UINTN Signature;\r
- IHANDLE *Handle; // Back pointer\r
LIST_ENTRY Link; // Link on IHANDLE.Protocols\r
+ IHANDLE *Handle; // Back pointer\r
LIST_ENTRY ByProtocol; // Link on PROTOCOL_ENTRY.Protocols\r
PROTOCOL_ENTRY *Protocol; // The protocol ID\r
VOID *Interface; // The interface value\r
\r
typedef struct {\r
UINTN Signature;\r
- LIST_ENTRY Link;\r
+ LIST_ENTRY Link; //Link on PROTOCOL_INTERFACE.OpenList\r
\r
EFI_HANDLE AgentHandle;\r
EFI_HANDLE ControllerHandle;\r
AlignedRemainingDevicePath = NULL;\r
if (RemainingDevicePath != NULL) {\r
AlignedRemainingDevicePath = DuplicateDevicePath (RemainingDevicePath);\r
+\r
+ if (AlignedRemainingDevicePath == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
}\r
\r
//\r
// Allocate a handle buffer for ControllerHandle's children\r
//\r
ChildHandleBuffer = AllocatePool (ChildHandleCount * sizeof(EFI_HANDLE));\r
+ if (ChildHandleBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
\r
//\r
// Fill in a handle buffer with ControllerHandle's children\r
/** @file\r
- UEFI notify infrastructure\r
+ Support functions for UEFI protocol notification infrastructure.\r
\r
Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
All rights reserved. This program and the accompanying materials\r
//\r
Prot = CoreFindProtocolInterface (UserHandle, Protocol, OldInterface);\r
if (Prot == NULL) {\r
- CoreReleaseProtocolLock ();\r
- return EFI_NOT_FOUND;\r
+ Status = EFI_NOT_FOUND;\r
+ goto Done;\r
}\r
\r
//\r
//\r
// One or more drivers refused to release, so return the error\r
//\r
- CoreReleaseProtocolLock ();\r
- return Status;\r
+ goto Done;\r
}\r
\r
//\r
Prot = CoreRemoveInterfaceFromProtocol (Handle, Protocol, OldInterface);\r
\r
if (Prot == NULL) {\r
- CoreReleaseProtocolLock ();\r
- return EFI_NOT_FOUND;\r
+ Status = EFI_NOT_FOUND;\r
+ goto Done;\r
}\r
\r
ProtEntry = Prot->Protocol;\r
// Release the lock and connect all drivers to UserHandle\r
//\r
CoreReleaseProtocolLock ();\r
- Status = CoreConnectController (\r
- UserHandle,\r
- NULL,\r
- NULL,\r
- TRUE\r
- );\r
+ //\r
+ // Return code is ignored on purpose.\r
+ //\r
+ CoreConnectController (\r
+ UserHandle,\r
+ NULL,\r
+ NULL,\r
+ TRUE\r
+ );\r
CoreAcquireProtocolLock ();\r
\r
//\r
\r
CoreReleaseProtocolLock ();\r
\r
- return EFI_SUCCESS;\r
+ Status = EFI_SUCCESS;\r
+\r
+Done:\r
+ return Status;\r
}\r