Skip to content

Commit

Permalink
MdeModulePkg DxeCore: Enhance memory profile code to handle possible …
Browse files Browse the repository at this point in the history
…NULL FilePath.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16595 6f19259b-4bc3-4df7-8a09-765794883524
  • Loading branch information
lzeng14 authored and lzeng14 committed Jan 9, 2015
1 parent a5077fd commit 092b852
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file
Support routines for UEFI memory profile.
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Expand Down Expand Up @@ -483,13 +483,15 @@ GetFileNameFromFilePath (
EFI_GUID *FileName;

FileName = NULL;
ThisFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) FilePath;
while (!IsDevicePathEnd (ThisFilePath)) {
FileName = EfiGetNameGuidFromFwVolDevicePathNode (ThisFilePath);
if (FileName != NULL) {
break;
if (FilePath != NULL) {
ThisFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) FilePath;
while (!IsDevicePathEnd (ThisFilePath)) {
FileName = EfiGetNameGuidFromFwVolDevicePathNode (ThisFilePath);
if (FileName != NULL) {
break;
}
ThisFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) NextDevicePathNode (ThisFilePath);
}
ThisFilePath = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) NextDevicePathNode (ThisFilePath);
}

return FileName;
Expand Down

0 comments on commit 092b852

Please sign in to comment.