]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.c
MdeModulePkg: Fix spelling mistake for occurred
[mirror_edk2.git] / MdeModulePkg / Universal / LoadFileOnFv2 / LoadFileOnFv2.c
index 6ef9facc93a4b023db2ee9b7e613efd1da416872..58e658ee08ef1bdb6450b9f82c00ef4815cac1cb 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Produce Load File Protocol for UEFI Applications in Firmware Volumes\r
 \r
-  Copyright (c) 2011 - 2013, Intel Corporation\r
-  All rights reserved. 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) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -42,7 +36,7 @@ typedef struct {
 #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_THIS(a) CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, LoadFile, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)\r
 #define LOAD_FILE_ON_FV2_PRIVATE_DATA_FROM_LINK(a) CR (a, LOAD_FILE_ON_FV2_PRIVATE_DATA, Link, LOAD_FILE_ON_FV2_PRIVATE_DATA_SIGNATURE)\r
 \r
-EFI_EVENT  mFvRegistration;\r
+VOID       *mFvRegistration;\r
 LIST_ENTRY mPrivateDataList;\r
 \r
 /**\r
@@ -157,7 +151,7 @@ LOAD_FILE_ON_FV2_PRIVATE_DATA  mLoadFileOnFv2PrivateDataTemplate = {
 /**\r
   Check if the FFS has been installed LoadFileProtocol for it.\r
 \r
-  @param EFI_GUID     File GUID.\r
+  @param[in] NameGuid Point to FFS File GUID to be checked.\r
 \r
   @retval TRUE        The FFS's FileLoadProtocol is in list.\r
   @retval FALSE       The FFS's FileLoadProtocol is not in list.\r
@@ -323,7 +317,7 @@ InstallFileLoadProtocol (
   EFI_FIRMWARE_VOLUME_PROTOCOL on the handle of the FFS. This notification function\r
   also handles the situation when LZMA decoder driver loaded later than FirmwareVolume driver.\r
 \r
-  @param  Event                 The event that occured\r
+  @param  Event                 The event that occurred\r
   @param  Context               Context of event. Not used in this nofication function.\r
 \r
 **/\r
@@ -345,6 +339,9 @@ FvNotificationEvent (
   Index      = 0;\r
   BufferSize = sizeof (EFI_HANDLE);\r
   Handle     = AllocateZeroPool (BufferSize);\r
+  if (Handle == NULL) {\r
+    return;\r
+  }\r
   Status = gBS->LocateHandle (\r
                     ByProtocol,\r
                     &gEfiFirmwareVolume2ProtocolGuid,\r
@@ -355,6 +352,9 @@ FvNotificationEvent (
   if (EFI_BUFFER_TOO_SMALL == Status) {\r
     FreePool (Handle);\r
     Handle = AllocateZeroPool (BufferSize);\r
+    if (Handle == NULL) {\r
+      return;\r
+    }\r
     Status = gBS->LocateHandle (\r
                     ByProtocol,\r
                     &gEfiFirmwareVolume2ProtocolGuid,\r