[efi] Fix error handling path in efi_snp_probe
authorIgnat Korchagin <ignat@cloudflare.com>
Fri, 4 Jan 2019 19:20:28 +0000 (19:20 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 15 Jan 2019 14:01:17 +0000 (14:01 +0000)
commite226fecd1b602ece7f4f208042f3e87ca540b297
tree6600bbb6a34906661d593654dba6a5116652eb67
parentba0d5aa993df4bad28b2a6a36c10b43c7e5c33f2
[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>
src/interface/efi/efi_snp.c