summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2023-06-23 17:08:25 +0200
committerMichael Brown2023-06-23 17:51:10 +0200
commitf0b1025503205515d5b105c37774596623481242 (patch)
tree95dfeadb51e62b2eab2acf2b1cec29f5471e2fe6
parent[efi] Pass more detailed driver information to veto methods (diff)
downloadipxe-f0b1025503205515d5b105c37774596623481242.tar.gz
ipxe-f0b1025503205515d5b105c37774596623481242.tar.xz
ipxe-f0b1025503205515d5b105c37774596623481242.zip
[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.c9
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;
}