[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



commit 7e11543c53396ea2e59320127573bf4151fae008
Author:     Szymon AcedaÅ?ski <accek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Jun 3 08:17:56 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jun 3 08:17:56 2026 +0200

    xen/efi: Use blexit() instead of BUG_ON() in read_file()
    
    Follow-up to 880e40b187aa, 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: 880e40b187aa ("xen/efi: Fix boot from a device without a file 
system")
    Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Szymon AcedaÅ?ski <accek@xxxxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
 xen/common/efi/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2971ea8696..8f24df9bc2 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -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,
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.