]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap
authorStar Zeng <star.zeng@intel.com>
Wed, 14 Feb 2018 09:10:36 +0000 (17:10 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 6 Mar 2018 14:31:48 +0000 (22:31 +0800)
NULL is returned to Mapping when Operation is BusMasterCommonBuffer or
BusMasterCommonBuffer64 in PeiIoMmuMap().
So Mapping == NULL is valid when calling PeiIoMmuUnmap().

940dbd071e9f01717236af236740aa0da716805f wrongly changed EFI_SUCCESS
to EFI_INVALID_PARAMETER when Mapping == NULL in PeiIoMmuUnmap().
This patch is to correct it.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c

index c6a1ccdb1b35d2e77cbcfd2540e496d4987b736c..2b2df1f425aef0041525d5aa90d8485ff02cda90 100644 (file)
@@ -189,7 +189,7 @@ PeiIoMmuMap (
   if (Operation == EdkiiIoMmuOperationBusMasterCommonBuffer ||\r
       Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) {\r
     *DeviceAddress = (UINTN)HostAddress;\r
-    *Mapping = 0;\r
+    *Mapping = NULL;\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -266,7 +266,7 @@ PeiIoMmuUnmap (
   }\r
 \r
   if (Mapping == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
+    return EFI_SUCCESS;\r
   }\r
 \r
   MapInfo = Mapping;\r