From 0407056e649dfe095e6d6e218a619a512896a9ae Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Thu, 6 Sep 2012 05:00:34 +0000 Subject: [PATCH] Check the return code from CoreLocateDevicePath() in MdeModulePkg/Core/Dxe/Image/Image.c CoreLoadImageCommon(). Signed-off-by: Star Zeng Reviewed-by: Liming Gao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13703 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/Image/Image.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index a3cffcefc1..16fc91056a 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -1079,7 +1079,10 @@ CoreLoadImageCommon ( if (SourceBuffer != NULL) { FHand.Source = SourceBuffer; FHand.SourceSize = SourceSize; - CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &HandleFilePath, &DeviceHandle); + Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &HandleFilePath, &DeviceHandle); + if (EFI_ERROR (Status)) { + DeviceHandle = NULL; + } if (SourceSize > 0) { Status = EFI_SUCCESS; } else {