From cc9a0425a21a41b723311801f5dfeb6e07ff9ed9 Mon Sep 17 00:00:00 2001 From: JinKang <2371488344@qq.com> Date: Mon, 10 Aug 2026 07:44:01 -0400 Subject: [PATCH] ShellPkg/Shell: Preserve multi-instance device paths EfiShellGetMapFromDevicePath() stops at any end-type node and converts an end-instance node into an end-entire node. This truncates a multi-instance device path and modifies the protocol data in place. Walk until the end-entire node instead. This leaves intermediate instances and the original device path unchanged. Signed-off-by: JinKang <2371488344@qq.com> --- ShellPkg/Application/Shell/ShellProtocol.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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); - } } /*