* [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap
@ 2018-03-05 13:33 Star Zeng
2018-03-05 22:38 ` Yao, Jiewen
0 siblings, 1 reply; 2+ messages in thread
From: Star Zeng @ 2018-03-05 13:33 UTC (permalink / raw)
To: edk2-devel; +Cc: Star Zeng, Jiewen Yao
NULL is returned to Mapping when Operation is BusMasterCommonBuffer or
EdkiiIoMmuOperationBusMasterCommonBuffer64 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>
---
IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index ea3091ef911c..6289834fcb38 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;
--
2.13.3.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap
2018-03-05 13:33 [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap Star Zeng
@ 2018-03-05 22:38 ` Yao, Jiewen
0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2018-03-05 22:38 UTC (permalink / raw)
To: Zeng, Star, edk2-devel@lists.01.org
Reviewed-by: jiewen.yao@intel.com
> -----Original Message-----
> From: Zeng, Star
> Sent: Monday, March 5, 2018 9:34 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping ==
> NULL in Unmap
>
> NULL is returned to Mapping when Operation is BusMasterCommonBuffer or
> EdkiiIoMmuOperationBusMasterCommonBuffer64 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>
> ---
> IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> index ea3091ef911c..6289834fcb38 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;
> --
> 2.13.3.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-05 22:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-05 13:33 [PATCH] IntelSiliconPkg VTdPmrPei: Return SUCCESS when Mapping == NULL in Unmap Star Zeng
2018-03-05 22:38 ` Yao, Jiewen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox