Revision: 15615
          http://sourceforge.net/p/edk2/code/15615
Author:   jljusten
Date:     2014-07-03 20:05:22 +0000 (Thu, 03 Jul 2014)
Log Message:
-----------
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 <pca...@zytor.com>
Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>

Modified Paths:
--------------
    trunk/edk2/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c

Modified: trunk/edk2/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c
===================================================================
--- trunk/edk2/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c 
2014-07-03 20:05:14 UTC (rev 15614)
+++ trunk/edk2/EmulatorPkg/EmuSimpleFileSystemDxe/EmuSimpleFileSystem.c 
2014-07-03 20:05:22 UTC (rev 15615)
@@ -501,6 +501,7 @@
 
   PrivateFile = AllocatePool (sizeof (EMU_EFI_FILE_PRIVATE));
   if (PrivateFile == NULL) {
+    Status = EFI_OUT_OF_RESOURCES;
     goto Done;
   }
 
@@ -722,6 +723,7 @@
 
   Private = AllocateZeroPool (sizeof (EMU_SIMPLE_FILE_SYSTEM_PRIVATE));
   if (Private == NULL) {
+    Status = EFI_OUT_OF_RESOURCES;
     goto Done;
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to