[ipxe-devel] [ipxe/ipxe] [efi_snp] Fix error handling path in efi_snp_probe (#86)

Ignat Korchagin notifications at github.com
Fri Jan 4 22:11:37 UTC 2019


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

Make it release the resources in the reverse order of obtaining them

Signed-off-by: Ignat Korchagin <ignat at cloudflare.com>
You can view, comment on, or merge this pull request online at:

  https://github.com/ipxe/ipxe/pull/86

-- Commit Summary --

  * [efi_snp] Fix error handling path in efi_snp_probe

-- File Changes --

    M src/interface/efi/efi_snp.c (6)

-- Patch Links --

https://github.com/ipxe/ipxe/pull/86.patch
https://github.com/ipxe/ipxe/pull/86.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ipxe/ipxe/pull/86
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20190104/d85d9a85/attachment.htm>


More information about the ipxe-devel mailing list