From fb91542f2a4a593955b620d514b0c0bd9d7af8cd Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 17 Dec 2020 19:48:08 +0000 Subject: [efi] Nullify interfaces unconditionally on error and shutdown paths Signed-off-by: Michael Brown --- src/interface/efi/efi_block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/interface/efi/efi_block.c') 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 ) { -- cgit v1.2.3-55-g7522