summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_block.c
diff options
context:
space:
mode:
authorMichael Brown2020-12-17 20:48:08 +0100
committerMichael Brown2020-12-17 20:52:41 +0100
commitfb91542f2a4a593955b620d514b0c0bd9d7af8cd (patch)
tree3147f3b03240ff5f30c8925e016b1eaf78b2a43b /src/interface/efi/efi_block.c
parent[iphone] Add iPhone tethering driver (diff)
downloadipxe-fb91542f2a4a593955b620d514b0c0bd9d7af8cd.tar.gz
ipxe-fb91542f2a4a593955b620d514b0c0bd9d7af8cd.tar.xz
ipxe-fb91542f2a4a593955b620d514b0c0bd9d7af8cd.zip
[efi] Nullify interfaces unconditionally on error and shutdown paths
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_block.c')
-rw-r--r--src/interface/efi/efi_block.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interface/efi/efi_block.c b/src/interface/efi/efi_block.c
index 19f669fd2..eeae8fca5 100644
--- a/src/interface/efi/efi_block.c
+++ b/src/interface/efi/efi_block.c
@@ -326,9 +326,9 @@ static int efi_block_hook ( unsigned int drive, struct uri **uris,
NULL ) ) != 0 ) {
DBGC ( sandev, "EFIBLK %#02x could not uninstall protocols: "
"%s\n", sandev->drive, strerror ( -EEFI ( efirc ) ) );
- efi_nullify_block ( &block->block_io );
leak = 1;
}
+ efi_nullify_block ( &block->block_io );
err_install:
if ( ! leak ) {
free ( block->path );
@@ -377,9 +377,9 @@ static void efi_block_unhook ( unsigned int drive ) {
NULL ) ) != 0 ) {
DBGC ( sandev, "EFIBLK %#02x could not uninstall protocols: "
"%s\n", sandev->drive, strerror ( -EEFI ( efirc ) ) );
- efi_nullify_block ( &block->block_io );
leak = 1;
}
+ efi_nullify_block ( &block->block_io );
/* Free device path */
if ( ! leak ) {