[PATCH master 25/39] efi: fix Fibre Channel device path type vs sub_type comparison

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Feb 16 00:44:25 PST 2026


dev_path_fibre() uses device_path_type() to distinguish FibreChannel
from FibreChannelEx, but device_path_type() returns the major type
field (DEVICE_PATH_TYPE_MESSAGING_DEVICE = 0x03), not the sub_type.
Since DEVICE_PATH_SUB_TYPE_MSG_FIBRECHANNEL also happens to be in the
messaging range, the comparison is coincidentally always true, making
FibreChannelEx paths incorrectly display as "Fibre" instead of
"FibreEx".

Compare header.sub_type directly to get the correct behavior.

Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 efi/devicepath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/efi/devicepath.c b/efi/devicepath.c
index bf65325fed8a..131c3df16641 100644
--- a/efi/devicepath.c
+++ b/efi/devicepath.c
@@ -232,7 +232,7 @@ dev_path_fibre(struct string *str, const void *dev_path)
 
 	Fibre = dev_path;
 	cprintf(str, "Fibre%s(0x%016llx,0x%016llx)",
-		device_path_type(&Fibre->header) ==
+		Fibre->header.sub_type ==
 		DEVICE_PATH_SUB_TYPE_MSG_FIBRECHANNEL ? "" : "Ex", Fibre->WWN, Fibre->Lun);
 }
 
-- 
2.47.3




More information about the barebox mailing list