MdeModulePkg UhciPei: Also check TempPtr against NULL to return error
authorStar Zeng <star.zeng@intel.com>
Thu, 23 Nov 2017 01:02:43 +0000 (09:02 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 24 Nov 2017 01:34:00 +0000 (09:34 +0800)
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>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c

index b7d60db..482c404 100644 (file)
@@ -2863,8 +2863,8 @@ CreateMemoryBlock (
              &MappedAddr,\r
              &Mapping\r
              );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
+  if (EFI_ERROR (Status) || (TempPtr == NULL)) {\r
+    return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
   Ptr = TempPtr;\r