]> git.baikalelectronics.ru Git - uboot.git/commit
efi_loader: CloseProtocol in tcg2_measure_gpt_data
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 7 Oct 2022 12:28:18 +0000 (14:28 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 10 Oct 2022 14:34:25 +0000 (16:34 +0200)
commit79ad9154c3b9bab120ac2b52c589c9806b3be968
tree4d6327ff382cae0b1da895d54393229a6cff3209
parent3d131c11ae8298425c6ffa780f06d4c2adee9508
efi_loader: CloseProtocol in tcg2_measure_gpt_data

The CloseProtocol() boot service requires a handle as first argument.
Passing the protocol interface is incorrect.

CloseProtocol() only has an effect if called with a non-zero value for
agent_handle. HandleProtocol() uses an opaque agent_handle when invoking
OpenProtocol() (currently NULL). Therefore HandleProtocol() should be
avoided.

* Replace the LocateHandle() call by efi_search_protocol().
* Remove the CloseProtocol() call.
* Remove a superfluous goto.

Fixes: dff942502ccd ("efi_loader: add UEFI GPT measurement")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_tcg2.c