summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c')
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
index 0a3ceb9f71..79575b6f63 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/UsbHcMem.c
@@ -250,6 +250,11 @@ UsbHcGetPciAddressForHostMem (
}
ASSERT ((Block != NULL));
+
+ if (Block == NULL) {
+ return 0;
+ }
+
//
// calculate the pci memory address for host memory address.
//
@@ -536,6 +541,10 @@ UsbHcFreeMem (
//
ASSERT (Block != NULL);
+ if (Block == NULL) {
+ return;
+ }
+
//
// Release the current memory block if it is empty and not the head
//