summaryrefslogtreecommitdiffstats
path: root/IntelSiliconPkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-02-14 17:10:36 +0800
committerStar Zeng <star.zeng@intel.com>2018-03-09 10:01:53 +0800
commit41ba79ea1e184605c194dcc07be3d16538e4d08a (patch)
tree25ed50f7d020ed55798913c44be7ff6ea4c87f22 /IntelSiliconPkg
parentd42b2619732f510e589aa107e73b6d84fea2679e (diff)
downloadedk2-41ba79ea1e184605c194dcc07be3d16538e4d08a.tar.gz
edk2-41ba79ea1e184605c194dcc07be3d16538e4d08a.tar.bz2
edk2-41ba79ea1e184605c194dcc07be3d16538e4d08a.zip
IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap
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> (cherry picked from commit abe63fa7dc0de3e1875139a4abd62357795f52d7)
Diffstat (limited to 'IntelSiliconPkg')
-rw-r--r--IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index c6a1ccdb1b..2b2df1f425 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
@@ -189,7 +189,7 @@ PeiIoMmuMap (
if (Operation == EdkiiIoMmuOperationBusMasterCommonBuffer ||
Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) {
*DeviceAddress = (UINTN)HostAddress;
- *Mapping = 0;
+ *Mapping = NULL;
return EFI_SUCCESS;
}
@@ -266,7 +266,7 @@ PeiIoMmuUnmap (
}
if (Mapping == NULL) {
- return EFI_INVALID_PARAMETER;
+ return EFI_SUCCESS;
}
MapInfo = Mapping;