diff options
author | Michael Brown <mcb30@ipxe.org> | 2020-12-17 19:48:08 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2020-12-17 19:52:41 +0000 |
commit | fb91542f2a4a593955b620d514b0c0bd9d7af8cd (patch) | |
tree | 3147f3b03240ff5f30c8925e016b1eaf78b2a43b /src/interface | |
parent | f47a45ea2d4ff0f7b725e0c069948c81ef8b67a1 (diff) | |
download | ipxe-fb91542f2a4a593955b620d514b0c0bd9d7af8cd.zip ipxe-fb91542f2a4a593955b620d514b0c0bd9d7af8cd.tar.gz ipxe-fb91542f2a4a593955b620d514b0c0bd9d7af8cd.tar.bz2 |
[efi] Nullify interfaces unconditionally on error and shutdown paths
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface')
-rw-r--r-- | src/interface/efi/efi_block.c | 4 | ||||
-rw-r--r-- | src/interface/efi/efi_pxe.c | 8 | ||||
-rw-r--r-- | src/interface/efi/efi_snp.c | 16 | ||||
-rw-r--r-- | src/interface/efi/efi_snp_hii.c | 4 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/interface/efi/efi_block.c b/src/interface/efi/efi_block.c index 19f669f..eeae8fc 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 ) { diff --git a/src/interface/efi/efi_pxe.c b/src/interface/efi/efi_pxe.c index 4422dd2..5c7bb95 100644 --- a/src/interface/efi/efi_pxe.c +++ b/src/interface/efi/efi_pxe.c @@ -1652,10 +1652,10 @@ int efi_pxe_install ( EFI_HANDLE handle, struct net_device *netdev ) { NULL ) ) != 0 ) { DBGC ( pxe, "PXE %s could not uninstall: %s\n", pxe->name, strerror ( -EEFI ( efirc ) ) ); - efi_nullify_pxe ( &pxe->base ); - efi_nullify_apple ( &pxe->apple ); leak = 1; } + efi_nullify_pxe ( &pxe->base ); + efi_nullify_apple ( &pxe->apple ); err_install_protocol: if ( ! leak ) ref_put ( &pxe->refcnt ); @@ -1695,10 +1695,10 @@ void efi_pxe_uninstall ( EFI_HANDLE handle ) { NULL ) ) != 0 ) { DBGC ( pxe, "PXE %s could not uninstall: %s\n", pxe->name, strerror ( -EEFI ( efirc ) ) ); - efi_nullify_pxe ( &pxe->base ); - efi_nullify_apple ( &pxe->apple ); leak = 1; } + efi_nullify_pxe ( &pxe->base ); + efi_nullify_apple ( &pxe->apple ); /* Remove from list and drop list's reference */ list_del ( &pxe->list ); diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c index 0a280ee..c08383e 100644 --- a/src/interface/efi/efi_snp.c +++ b/src/interface/efi/efi_snp.c @@ -1816,12 +1816,12 @@ static int efi_snp_probe ( struct net_device *netdev ) { NULL ) ) != 0 ) { DBGC ( snpdev, "SNPDEV %p could not uninstall: %s\n", snpdev, strerror ( -EEFI ( efirc ) ) ); - efi_nullify_snp ( &snpdev->snp ); - efi_nullify_nii ( &snpdev->nii ); - efi_nullify_name2 ( &snpdev->name2 ); - efi_nullify_load_file ( &snpdev->load_file ); leak = 1; } + efi_nullify_snp ( &snpdev->snp ); + efi_nullify_nii ( &snpdev->nii ); + efi_nullify_name2 ( &snpdev->name2 ); + efi_nullify_load_file ( &snpdev->load_file ); err_install_protocol_interface: if ( ! leak ) free ( snpdev->path ); @@ -1903,12 +1903,12 @@ static void efi_snp_remove ( struct net_device *netdev ) { NULL ) ) != 0 ) { DBGC ( snpdev, "SNPDEV %p could not uninstall: %s\n", snpdev, strerror ( -EEFI ( efirc ) ) ); - efi_nullify_snp ( &snpdev->snp ); - efi_nullify_nii ( &snpdev->nii ); - efi_nullify_name2 ( &snpdev->name2 ); - efi_nullify_load_file ( &snpdev->load_file ); leak = 1; } + efi_nullify_snp ( &snpdev->snp ); + efi_nullify_nii ( &snpdev->nii ); + efi_nullify_name2 ( &snpdev->name2 ); + efi_nullify_load_file ( &snpdev->load_file ); if ( ! leak ) free ( snpdev->path ); bs->CloseEvent ( snpdev->snp.WaitForPacket ); diff --git a/src/interface/efi/efi_snp_hii.c b/src/interface/efi/efi_snp_hii.c index 4bb7214..8ca8e69 100644 --- a/src/interface/efi/efi_snp_hii.c +++ b/src/interface/efi/efi_snp_hii.c @@ -759,9 +759,9 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) { NULL ) ) != 0 ) { DBGC ( snpdev, "SNPDEV %p could not uninstall HII protocol: " "%s\n", snpdev, strerror ( -EEFI ( efirc ) ) ); - efi_nullify_hii ( &snpdev->hii ); leak = 1; } + efi_nullify_hii ( &snpdev->hii ); err_install_protocol: if ( ! leak ) efihii->RemovePackageList ( efihii, snpdev->hii_handle ); @@ -812,9 +812,9 @@ int efi_snp_hii_uninstall ( struct efi_snp_device *snpdev ) { NULL ) ) != 0 ) { DBGC ( snpdev, "SNPDEV %p could not uninstall HII protocol: " "%s\n", snpdev, strerror ( -EEFI ( efirc ) ) ); - efi_nullify_hii ( &snpdev->hii ); leak = 1; } + efi_nullify_hii ( &snpdev->hii ); if ( ! leak ) efihii->RemovePackageList ( efihii, snpdev->hii_handle ); if ( ( efirc = bs->UninstallMultipleProtocolInterfaces ( |