Browse Source

[efi] Fix error handling path in efi_snp_probe

Current (simplified):

1. InstallMultipleProtocolInterfaces
       if err goto err_install_protocol_interface;
2. OpenProtocol(efi_nii_protocol_guid)
       if err goto err_open_nii;
3. OpenProtocol(efi_nii31_protocol_guid)
       if err goto err_open_nii31;
4. efi_child_add
       if err goto err_efi_child_add;
...
err_efi_child_add:
   CloseProtocol(efi_nii_protocol_guid) <= should be efi_nii31_protocol_guid
err_open_nii: <= should be err_open_nii31
   CloseProtocol(efi_nii31_protocol_guid) <= should be efi_nii_protocol_guid
err_open_nii31: <= should be err_open_nii
   UninstallMultipleProtocolInterfaces

Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Ignat Korchagin 5 years ago
parent
commit
e226fecd1b
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/interface/efi/efi_snp.c

+ 3
- 3
src/interface/efi/efi_snp.c View File

1829
 		efi_snp_hii_uninstall ( snpdev );
1829
 		efi_snp_hii_uninstall ( snpdev );
1830
 	efi_child_del ( efidev->device, snpdev->handle );
1830
 	efi_child_del ( efidev->device, snpdev->handle );
1831
  err_efi_child_add:
1831
  err_efi_child_add:
1832
-	bs->CloseProtocol ( snpdev->handle, &efi_nii_protocol_guid,
1833
-			    efi_image_handle, snpdev->handle );
1834
- err_open_nii:
1835
 	bs->CloseProtocol ( snpdev->handle, &efi_nii31_protocol_guid,
1832
 	bs->CloseProtocol ( snpdev->handle, &efi_nii31_protocol_guid,
1836
 			    efi_image_handle, snpdev->handle );
1833
 			    efi_image_handle, snpdev->handle );
1837
  err_open_nii31:
1834
  err_open_nii31:
1835
+	bs->CloseProtocol ( snpdev->handle, &efi_nii_protocol_guid,
1836
+			    efi_image_handle, snpdev->handle );
1837
+ err_open_nii:
1838
 	bs->UninstallMultipleProtocolInterfaces (
1838
 	bs->UninstallMultipleProtocolInterfaces (
1839
 			snpdev->handle,
1839
 			snpdev->handle,
1840
 			&efi_simple_network_protocol_guid, &snpdev->snp,
1840
 			&efi_simple_network_protocol_guid, &snpdev->snp,

Loading…
Cancel
Save