diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-06-23 16:08:25 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-06-23 16:51:10 +0100 |
commit | f0b1025503205515d5b105c37774596623481242 (patch) | |
tree | 95dfeadb51e62b2eab2acf2b1cec29f5471e2fe6 | |
parent | c832580f197dac013edb72ce031570d66a9448f6 (diff) | |
download | ipxe-f0b1025503205515d5b105c37774596623481242.tar.gz |
[efi] Unload vetoed drivers by image handle rather than driver handle
In most cases, the driver handle will be the image handle itself.
However, this is not required by the UEFI specification, and some
images will install multiple driver binding handles.
Use the image handle (extracted from the driver binding protocol
instance) when attempting to unload the driver's image.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/interface/efi/efi_veto.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/interface/efi/efi_veto.c b/src/interface/efi/efi_veto.c index 79c157571..3e0806e01 100644 --- a/src/interface/efi/efi_veto.c +++ b/src/interface/efi/efi_veto.c @@ -78,14 +78,17 @@ struct efi_veto { static int efi_veto_unload ( struct efi_veto *veto ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; EFI_HANDLE driver = veto->driver; + EFI_HANDLE image = veto->image; EFI_STATUS efirc; int rc; /* Unload the driver */ - if ( ( efirc = bs->UnloadImage ( driver ) ) != 0 ) { + if ( ( efirc = bs->UnloadImage ( image ) ) != 0 ) { rc = -EEFI ( efirc ); - DBGC ( driver, "EFIVETO %s could not unload: %s\n", - efi_handle_name ( driver ), strerror ( rc ) ); + DBGC ( driver, "EFIVETO %s could not unload", + efi_handle_name ( driver ) ); + DBGC ( driver, " %s: %s\n", efi_handle_name ( image ), + strerror ( rc ) ); return rc; } |