3) A support protocol is not found, and the data is not available to be read\r
without it. This results in EFI_PROTOCOL_ERROR.\r
\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
UINTN EncapsulatedStreamHandle;\r
EFI_GUID *EncapsulationGuid;\r
//\r
- // If the section REQUIRES an extraction protocol, register for RPN \r
+ // If the section REQUIRES an extraction protocol, register for RPN\r
// when the required GUIDed extraction protocol becomes available.\r
//\r
EFI_EVENT Event;\r
\r
@return TRUE The GuidedSectionGuid could be identified, and the pointer to\r
the Guided Section Extraction Protocol will be returned to *GuidedSectionExtraction.\r
- @return FALSE The GuidedSectionGuid could not be identified, or \r
+ @return FALSE The GuidedSectionGuid could not be identified, or\r
the Guided Section Extraction Protocol has not been installed yet.\r
\r
**/\r
UINTN NewStreamBufferSize;\r
UINT32 AuthenticationStatus;\r
RPN_EVENT_CONTEXT *Context;\r
- \r
+\r
Context = RpnContext;\r
- \r
+\r
GuidedHeader = (EFI_GUID_DEFINED_SECTION *) (Context->ParentStream->StreamBuffer + Context->ChildNode->OffsetInStream);\r
ASSERT (GuidedHeader->CommonHeader.Type == EFI_SECTION_GUID_DEFINED);\r
\r
gBS->CloseEvent (Event);\r
Context->ChildNode->Event = NULL;\r
FreePool (Context);\r
-} \r
+}\r
\r
/**\r
Constructor for RPN event when a missing GUIDED_SECTION_EXTRACTION_PROTOCOL appears...\r
)\r
{\r
RPN_EVENT_CONTEXT *Context;\r
- \r
+\r
//\r
// Allocate new event structure and context\r
//\r
Context = AllocatePool (sizeof (RPN_EVENT_CONTEXT));\r
ASSERT (Context != NULL);\r
- \r
+\r
Context->ChildNode = ChildNode;\r
Context->ParentStream = ParentStream;\r
- \r
+\r
Context->ChildNode->Event = EfiCreateProtocolNotifyEvent (\r
Context->ChildNode->EncapsulationGuid,\r
TPL_NOTIFY,\r
//\r
if ((GuidedSectionAttributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {\r
//\r
- // If the section REQUIRES an extraction protocol, register for RPN \r
- // when the required GUIDed extraction protocol becomes available. \r
+ // If the section REQUIRES an extraction protocol, register for RPN\r
+ // when the required GUIDed extraction protocol becomes available.\r
//\r
CreateGuidedExtractionRpnEvent (Stream, Node);\r
} else {\r
//\r
AllocatedOutputBuffer = AllocatePool (OutputBufferSize);\r
if (AllocatedOutputBuffer == NULL) {\r
- FreePool (ScratchBuffer);\r
+ if (ScratchBuffer != NULL) {\r
+ FreePool (ScratchBuffer);\r
+ }\r
return EFI_OUT_OF_RESOURCES;\r
}\r
*OutputBuffer = AllocatedOutputBuffer;\r