if (SourceBuffer != NULL) {\r
FHand.Source = SourceBuffer;\r
FHand.SourceSize = SourceSize;\r
- CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &HandleFilePath, &DeviceHandle);\r
+ Status = CoreLocateDevicePath (&gEfiDevicePathProtocolGuid, &HandleFilePath, &DeviceHandle);\r
+ if (EFI_ERROR (Status)) {\r
+ DeviceHandle = NULL;\r
+ }\r
if (SourceSize > 0) {\r
Status = EFI_SUCCESS;\r
} else {\r