Revision: 16595
          http://sourceforge.net/p/edk2/code/16595
Author:   lzeng14
Date:     2015-01-09 08:46:47 +0000 (Fri, 09 Jan 2015)
Log Message:
-----------
MdeModulePkg DxeCore: Enhance memory profile code to handle possible NULL 
FilePath.

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

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c

Modified: trunk/edk2/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
===================================================================
--- trunk/edk2/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c  2015-01-09 
04:50:11 UTC (rev 16594)
+++ trunk/edk2/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c  2015-01-09 
08:46:47 UTC (rev 16595)
@@ -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
@@ -483,13 +483,15 @@
   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;


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to