From 56fb9faa606fa72c8c10c34939bbe6da55979435 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 23 Nov 2017 09:02:43 +0800 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 Reviewed-by: Hao Wu --- 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 b7d60db0c9..482c404c0e 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.39.2