diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index 6a298a7f06..7c74cebf08 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -290,17 +290,9 @@ EfiShellGetMapFromDevicePath ( } if (PathForReturn != NULL) { - while (!IsDevicePathEndType (*DevicePath)) { + while (!IsDevicePathEnd (*DevicePath)) { *DevicePath = NextDevicePathNode (*DevicePath); } - - // - // Do not call SetDevicePathEndNode() if the device path node is already the - // end of an entire device path. - // - if (!IsDevicePathEnd (*DevicePath)) { - SetDevicePathEndNode (*DevicePath); - } } /*