summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Application/Shell/ShellProtocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Application/Shell/ShellProtocol.c')
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index 509eb60e40..e6d20ab164 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -294,7 +294,13 @@ EfiShellGetMapFromDevicePath (
*DevicePath = NextDevicePathNode (*DevicePath);
}
- SetDevicePathEndNode (*DevicePath);
+ //
+ // Do not call SetDevicePathEndNode() if the device path node is already the
+ // end of an entire device path.
+ //
+ if (!IsDevicePathEnd (*DevicePath)) {
+ SetDevicePathEndNode (*DevicePath);
+ }
}
/*