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

2017-11-22 Thread Wu, Hao A
Reviewed-by: Hao Wu 

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 
> Cc: Jiewen Yao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
>  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 (
>   ,
>   
>   );
> -  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


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

2017-11-22 Thread Star Zeng
Cc: Hao Wu 
Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 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 (
  ,
  
  );
-  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