[edk2] [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL to return error

Star Zeng posted 1 patch 6 years, 5 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[edk2] [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL to return error
Posted by Star Zeng 6 years, 5 months ago
Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
index b7d60db0c94e..482c404c0eae 100644
--- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
+++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
@@ -2863,8 +2863,8 @@ CreateMemoryBlock (
              &MappedAddr,
              &Mapping
              );
-  if (EFI_ERROR (Status)) {
-    return Status;
+  if (EFI_ERROR (Status) || (TempPtr == NULL)) {
+    return EFI_OUT_OF_RESOURCES;
   }
 
   Ptr = TempPtr;
-- 
2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL to return error
Posted by Wu, Hao A 6 years, 5 months ago
Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: Zeng, Star
> Sent: Thursday, November 23, 2017 9:04 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star; Wu, Hao A; Yao, Jiewen
> Subject: [PATCH] MdeModulePkg UhciPei: Also check TempPtr against NULL
> to return error
> 
> Cc: Hao Wu <hao.a.wu@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
>  MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> index b7d60db0c94e..482c404c0eae 100644
> --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c
> @@ -2863,8 +2863,8 @@ CreateMemoryBlock (
>               &MappedAddr,
>               &Mapping
>               );
> -  if (EFI_ERROR (Status)) {
> -    return Status;
> +  if (EFI_ERROR (Status) || (TempPtr == NULL)) {
> +    return EFI_OUT_OF_RESOURCES;
>    }
> 
>    Ptr = TempPtr;
> --
> 2.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel