MdeModulePkg EhciPei: Also check Buf against NULL to return error
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / EhciPei / EhciSched.c
index 606a53db1da1fe21fbdf43676ec1e4b0ab67d527..6b19362699b10619b8cbcb0fc34a02d386d5cbb3 100644 (file)
@@ -134,7 +134,7 @@ EhcInitSched (
              &Map\r
              );\r
 \r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || (Buf == NULL)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r