]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg SmmIoLib: Use NULL pointer check instead of useless Status check
authorStar Zeng <star.zeng@intel.com>
Mon, 5 Jun 2017 06:31:19 +0000 (14:31 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 6 Jun 2017 01:07:10 +0000 (09:07 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=587

The Status check in "if (!EFI_ERROR (Status))" condition is useless,
it should be NULL pointer check. And this patch also fixes a typo
"continous" to "continuous".

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdePkg/Library/SmmIoLib/SmmIoLib.c

index 181abb8e25df98d828d6af9120480b3fc379a96e..f1cb0dace5006fbbd8c6faa079ad32ca97d9127f 100644 (file)
@@ -156,7 +156,7 @@ SmmIsMmioValid (
 }\r
 \r
 /**\r
-  Merge continous entries whose type is EfiGcdMemoryTypeMemoryMappedIo.\r
+  Merge continuous entries whose type is EfiGcdMemoryTypeMemoryMappedIo.\r
 \r
   @param[in, out]  GcdMemoryMap           A pointer to the buffer in which firmware places\r
                                           the current GCD memory map.\r
@@ -217,7 +217,8 @@ MergeGcdMmioEntry (
   @param[in] Interface  Points to the interface instance.\r
   @param[in] Handle     The handle on which the interface was installed.\r
 \r
-  @retval EFI_SUCCESS   Notification runs successfully.\r
+  @retval EFI_SUCCESS           Notification runs successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  No enough resources to save GCD MMIO map.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -237,10 +238,10 @@ SmmIoLibInternalEndOfDxeNotify (
     MergeGcdMmioEntry (MemSpaceMap, &NumberOfDescriptors);\r
 \r
     mSmmIoLibGcdMemSpace = AllocateCopyPool (NumberOfDescriptors * sizeof (EFI_GCD_MEMORY_SPACE_DESCRIPTOR), MemSpaceMap);\r
-    ASSERT_EFI_ERROR (Status);\r
-    if (EFI_ERROR (Status)) {\r
+    ASSERT (mSmmIoLibGcdMemSpace != NULL);\r
+    if (mSmmIoLibGcdMemSpace == NULL) {\r
       gBS->FreePool (MemSpaceMap);\r
-      return Status;\r
+      return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
     mSmmIoLibGcdMemNumberOfDesc = NumberOfDescriptors;\r