]> git.ipfire.org Git - thirdparty/grub.git/commit
util/grub-protect: Correct uninit "err" variable
authorAndrew Hamilton <adhamilt@gmail.com>
Wed, 18 Jun 2025 01:58:26 +0000 (20:58 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 26 Jun 2025 15:19:25 +0000 (17:19 +0200)
commit409e72cedf68cabb1af99021a959a7990fb18b0a
tree7c13f19a594c130534be21ec02a51aa1f0a369c6
parent5eca564b19f4891990074200b2391d3c0ab92b42
util/grub-protect: Correct uninit "err" variable

In function protect_tpm2_export_tpm2key(), the "err" variable
is uninitialized in the normal (error free) path, so ensure this
defaults to GRUB_ERR_NONE.

This causes the GRUB build to fail with clang (observed with clang-14).

Fixes: 5934bf51c (util/grub-protect: Support NV index mode)
Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-protect.c