]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
SecurityPkg: Fix few typos
[mirror_edk2.git] / SecurityPkg / Library / DxeTpm2MeasureBootLib / DxeTpm2MeasureBootLib.c
index 543635b2e493abe0d2ec0887ebbe3a641b959417..f0e95e5ec01e3d28e15ba15ba535e704824ae08b 100644 (file)
@@ -362,7 +362,7 @@ Tcg2MeasurePeImage (
   if (Status == EFI_VOLUME_FULL) {\r
     //\r
     // Volume full here means the image is hashed and its result is extended to PCR.\r
-    // But the event log cann't be saved since log area is full.\r
+    // But the event log can't be saved since log area is full.\r
     // Just return EFI_SUCCESS in order not to block the image load.\r
     //\r
     Status = EFI_SUCCESS;\r
@@ -384,7 +384,7 @@ Finish:
   and other exception operations.  The File parameter allows for possible logging\r
   within the SAP of the driver.\r
 \r
-  If File is NULL, then EFI_INVALID_PARAMETER is returned.\r
+  If File is NULL, then EFI_ACCESS_DENIED is returned.\r
 \r
   If the file specified by File with an authentication status specified by\r
   AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.\r
@@ -435,6 +435,13 @@ DxeTpm2MeasureBootHandler (
   EFI_PHYSICAL_ADDRESS                FvAddress;\r
   UINT32                              Index;\r
 \r
+  //\r
+  // Check for invalid parameters.\r
+  //\r
+  if (File == NULL) {\r
+    return EFI_ACCESS_DENIED;\r
+  }\r
+\r
   Status = gBS->LocateProtocol (&gEfiTcg2ProtocolGuid, NULL, (VOID **) &Tcg2Protocol);\r
   if (EFI_ERROR (Status)) {\r
     //\r
@@ -471,7 +478,7 @@ DxeTpm2MeasureBootHandler (
   Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DevicePathNode, &Handle);\r
   if (!EFI_ERROR (Status) && !mTcg2MeasureGptTableFlag) {\r
     //\r
-    // Find the gpt partion on the given devicepath\r
+    // Find the gpt partition on the given devicepath\r
     //\r
     DevicePathNode = OrigDevicePathNode;\r
     ASSERT (DevicePathNode != NULL);\r
@@ -541,7 +548,7 @@ DxeTpm2MeasureBootHandler (
     }\r
     //\r
     // The PE image from unmeasured Firmware volume need be measured\r
-    // The PE image from measured Firmware volume will be mearsured according to policy below.\r
+    // The PE image from measured Firmware volume will be measured according to policy below.\r
     //   If it is driver, do not measure\r
     //   If it is application, still measure.\r
     //\r