diff options
author | Chris Coulson <chris.coulson@canonical.com> | 2021-03-18 17:09:03 +0000 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2021-03-18 22:47:43 -0400 |
commit | d4494b5cff75b64a70cb27b2d8544b4debb7fa6b (patch) | |
tree | 78915749f60025bd20faec7fdc3bc8f666d276e1 | |
parent | 3dd40ade68c6ff63e776b5f9acbd811a3c345d01 (diff) | |
download | efi-boot-shim-upstream/shim-15.3-rc3.tar.gz efi-boot-shim-upstream/shim-15.3-rc3.zip |
Avoid creating unnecessary mirrored MOK variablesupstream/shim-15.3-rc3shim-15.3-rc3
If the bootservices MOK payload fits in to a single volatile
runtime variable, don't create additional mirrored variables in
the second pass of mirror_mok_db().
-rw-r--r-- | mok.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -358,19 +358,19 @@ mirror_mok_db(CHAR16 *name, CHAR8 *name8, EFI_GUID *guid, UINT32 attrs, EFI_STATUS efi_status = EFI_SUCCESS; SIZE_T max_var_sz; - if (only_first) { - efi_status = get_max_var_sz(attrs, &max_var_sz); - if (EFI_ERROR(efi_status)) { - LogError(L"Could not get maximum variable size: %r", - efi_status); - return efi_status; - } + efi_status = get_max_var_sz(attrs, &max_var_sz); + if (EFI_ERROR(efi_status)) { + LogError(L"Could not get maximum variable size: %r", + efi_status); + return efi_status; + } - if (FullDataSize <= max_var_sz) { + if (FullDataSize <= max_var_sz) { + if (only_first) efi_status = SetVariable(name, guid, attrs, FullDataSize, FullData); - return efi_status; - } + + return efi_status; } CHAR16 *namen; |