xen/efi: Use blexit() instead of BUG_ON() in read_file()

Follow-up to 880e40b187, which added a BUG_ON() guard in read_file().

But as Jan pointed out, before ExitBootServices BUG_ON()
is not functional. It results in a hang with no message.

On the other hand blexit() prints a message and returns back
to the bootloader.

Fixes: 880e40b187 ("xen/efi: Fix boot from a device without a file system")
Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Szymon Acedański <accek@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
This commit is contained in:
Szymon Acedański authored and Jan Beulich committed 2026-06-03 08:17:56 +02:00
1 parent 2220363115
commit 7e11543c53
1 file changed
+2 -1
+2 -1
View File
@@ -849,7 +849,8 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
if ( !name )
PrintErrMesg(L"No filename", EFI_OUT_OF_RESOURCES);
BUG_ON(!dir_handle);
if ( !dir_handle )
blexit(L"BUG: !dir_handle in read_file()");
what = L"Open";
ret = dir_handle->Open(dir_handle, &FileHandle, name,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.