mirror of https://github.com/acidanthera/audk.git
ShellPkg/DMem: Handle memory allocation failure
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
parent
107d05a433
commit
c87bb070a6
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Dmem shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
|
||||
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
|
||||
This program and the accompanying materials
|
||||
|
@ -68,7 +68,9 @@ DisplayMmioMemory(
|
|||
return (SHELL_NOT_FOUND);
|
||||
}
|
||||
Buffer = AllocateZeroPool(Size);
|
||||
ASSERT(Buffer != NULL);
|
||||
if (Buffer == NULL) {
|
||||
return SHELL_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
|
|
Loading…
Reference in New Issue