summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@zytor.com>2014-07-03 20:05:22 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2014-07-03 20:05:22 +0000
commitdda74d6d62806a6d2d1ebd3792f2825412ff25ea (patch)
tree18fb56a28ac967ca53bc01b78c4d6a3b2b959683
parent4451c6eb6a352aa87f2d13db27462c354c76644e (diff)
downloadedk2-platforms-dda74d6d62806a6d2d1ebd3792f2825412ff25ea.tar.xz
EmulatorPkg/EmuSimpleFileSystemDxe: Fix incorrect return values upon allocation failure
In EmuSimpleFileSystemOpenVolume() function - in case an allocation failed with AllocatePool() - EFI_UNSUPPORTED was being returned instead of EFI_OUT_OF_RESOURCES, which is incorrect. Even worse, in EmuSimpleFileSystemDriverBindingStart(), an unitiliasied variable (Status) will be returned in case of an allocation failure with AllocateZeroPool(). This patch fixes both issues by correctly returning EFI_OUT_OF_RESOURCES. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15615 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c b/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
index 543ea772bf..4709f7a46f 100644
--- a/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
+++ b/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
@@ -501,6 +501,7 @@ EmuSimpleFileSystemOpenVolume (
PrivateFile = AllocatePool (sizeof (EMU_EFI_FILE_PRIVATE));
if (PrivateFile == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
@@ -722,6 +723,7 @@ EmuSimpleFileSystemDriverBindingStart (
Private = AllocateZeroPool (sizeof (EMU_SIMPLE_FILE_SYSTEM_PRIVATE));
if (Private == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
goto Done;
}