OUT VOID **HostAddress\r
)\r
{\r
+ VOID *Allocation;\r
+\r
if (HostAddress == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
// We used uncached memory to keep coherency\r
//\r
if (MemoryType == EfiBootServicesData) {\r
- *HostAddress = UncachedAllocatePages (Pages);\r
+ Allocation = UncachedAllocatePages (Pages);\r
} else if (MemoryType == EfiRuntimeServicesData) {\r
- *HostAddress = UncachedAllocateRuntimePages (Pages);\r
+ Allocation = UncachedAllocateRuntimePages (Pages);\r
} else {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ if (Allocation == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+\r
+ *HostAddress = Allocation;\r
+\r
return EFI_SUCCESS;\r
}\r
\r