<p>Current (simplified):</p>
<ol>
<li>InstallMultipleProtocolInterfaces<br>
if err goto err_install_protocol_interface;</li>
<li>OpenProtocol(efi_nii_protocol_guid)<br>
if err goto err_open_nii;</li>
<li>OpenProtocol(efi_nii31_protocol_guid)<br>
if err goto err_open_nii31;</li>
<li>efi_child_add<br>
if err goto err_efi_child_add;<br>
...<br>
err_efi_child_add:<br>
CloseProtocol(efi_nii_protocol_guid) <= should be efi_nii31_protocol_guid<br>
err_open_nii: <= should be err_open_nii31<br>
CloseProtocol(efi_nii31_protocol_guid) <= should be efi_nii_protocol_guid<br>
err_open_nii31: <= should be err_open_nii<br>
UninstallMultipleProtocolInterfaces</li>
</ol>
<p>Make it release the resources in the reverse order of obtaining them</p>
<p>Signed-off-by: Ignat Korchagin <a href="mailto:ignat@cloudflare.com">ignat@cloudflare.com</a></p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/ipxe/ipxe/pull/86'>https://github.com/ipxe/ipxe/pull/86</a></p>
<h4>Commit Summary</h4>
<ul>
<li>[efi_snp] Fix error handling path in efi_snp_probe</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/ipxe/ipxe/pull/86/files#diff-0">src/interface/efi/efi_snp.c</a>
(6)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/ipxe/ipxe/pull/86.patch'>https://github.com/ipxe/ipxe/pull/86.patch</a></li>
<li><a href='https://github.com/ipxe/ipxe/pull/86.diff'>https://github.com/ipxe/ipxe/pull/86.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ipxe/ipxe/pull/86">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AArTVBvP3E1k-5VfkmW4jtBy0ZRSrUrQks5u_9GZgaJpZM4Zt56l">mute the thread</a>.<img src="https://github.com/notifications/beacon/AArTVE8c3ovjCWAJiR9mldJeE2CEv38rks5u_9GZgaJpZM4Zt56l.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/ipxe/ipxe","title":"ipxe/ipxe","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/ipxe/ipxe"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"[efi_snp] Fix error handling path in efi_snp_probe (#86)"}],"action":{"name":"View Pull Request","url":"https://github.com/ipxe/ipxe/pull/86"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ipxe/ipxe/pull/86",
"url": "https://github.com/ipxe/ipxe/pull/86",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>