]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Unload started images only on failure
authorMichael Brown <mcb30@ipxe.org>
Wed, 30 Jul 2014 15:07:25 +0000 (16:07 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 30 Jul 2014 15:07:25 +0000 (16:07 +0100)
commitb53d4ae398e74846a6590fc48c295f319397e9c1
treebc87d9f4ca23ecf75258080481f23c39ee019be8
parentdc18fd76488476c8bd5b70ba228576d328280670
[efi] Unload started images only on failure

If the StartImage() call returns with no error, then the image must
have been started and returned successfully.  It either unloaded
itself, or it intended to remain loaded (e.g. it was a driver).  We
therefore do not unload successful images.

If there was an error, we attempt to unload the image.  This may not
work.  In particular, there is no way to tell whether an error
returned from StartImage() was due to being unable to start the image
(in which case we probably should call UnloadImage()), or due to the
image itself returning an error (in which case we probably should not
call UnloadImage()).  We therefore ignore any failures from the
UnloadImage() call itself.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/image/efi_image.c