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().
940dbd071e
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>
This commit is contained in:
@@ -189,7 +189,7 @@ PeiIoMmuMap (
|
|||||||
if (Operation == EdkiiIoMmuOperationBusMasterCommonBuffer ||
|
if (Operation == EdkiiIoMmuOperationBusMasterCommonBuffer ||
|
||||||
Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) {
|
Operation == EdkiiIoMmuOperationBusMasterCommonBuffer64) {
|
||||||
*DeviceAddress = (UINTN)HostAddress;
|
*DeviceAddress = (UINTN)HostAddress;
|
||||||
*Mapping = 0;
|
*Mapping = NULL;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ PeiIoMmuUnmap (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Mapping == NULL) {
|
if (Mapping == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapInfo = Mapping;
|
MapInfo = Mapping;
|
||||||
|
Reference in New Issue
Block a user