]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Application/Shell/ShellProtocol.c
ShellPkg/Shell: Do not set end device path if already end
[mirror_edk2.git] / ShellPkg / Application / Shell / ShellProtocol.c
index 509eb60e40f493dce1b1b926b141b07fac07fe70..e6d20ab16479e34654c3a8c907a426f9791ccdd8 100644 (file)
@@ -294,7 +294,13 @@ EfiShellGetMapFromDevicePath (
       *DevicePath = NextDevicePathNode (*DevicePath);\r
     }\r
 \r
-    SetDevicePathEndNode (*DevicePath);\r
+    //\r
+    // Do not call SetDevicePathEndNode() if the device path node is already the\r
+    // end of an entire device path.\r
+    //\r
+    if (!IsDevicePathEnd (*DevicePath)) {\r
+      SetDevicePathEndNode (*DevicePath);\r
+    }\r
   }\r
 \r
   /*\r