]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Return empty string when END device path is passed in to align the original behavior...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Sep 2011 02:56:38 +0000 (02:56 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Sep 2011 02:56:38 +0000 (02:56 +0000)
Signed-off-by: niruiyu
Reviewed-by: erictian
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12402 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c

index d169c4d0d5013a5bad7ef0f4840b0765c599f6e9..d7cff207fe60181dd0ff12b5a04d20227c9c015d 100644 (file)
@@ -1875,6 +1875,7 @@ ConvertDeviceNodeToText (
   //\r
   DumpNode (&Str, (VOID *) DeviceNode, DisplayOnly, AllowShortcuts);\r
 \r
+  ASSERT (Str.Str != NULL);\r
   return Str.Str;\r
 }\r
 \r
@@ -1959,5 +1960,9 @@ ConvertDevicePathToText (
     DevPathNode = NextDevicePathNode (DevPathNode);\r
   }\r
 \r
-  return Str.Str;\r
+  if (Str.Str == NULL) {\r
+    return AllocateZeroPool (sizeof (CHAR16));\r
+  } else {\r
+    return Str.Str;\r
+  }\r
 }\r