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>
This commit is contained in:
parent
5eca564b19
commit
409e72cedf
@ -703,7 +703,7 @@ protect_tpm2_export_tpm2key (const protect_args_t *args, tpm2_sealed_key_t *seal
|
|||||||
struct grub_tpm2_buffer priv_buf;
|
struct grub_tpm2_buffer priv_buf;
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret;
|
||||||
grub_err_t err;
|
grub_err_t err = GRUB_ERR_NONE;
|
||||||
|
|
||||||
if (der_buf == NULL)
|
if (der_buf == NULL)
|
||||||
return GRUB_ERR_BAD_ARGUMENT;
|
return GRUB_ERR_BAD_ARGUMENT;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user