summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2020-07-23 19:01:27 -0400
committerPeter Jones <pjones@redhat.com>2020-07-23 20:53:24 -0400
commit6df96cdb20b84b33027d2e40bc0dbe0676d31282 (patch)
tree057067ffa65b1adfbb7011e4949b6c5b8f997d6a /MokManager.c
parentd3b7dc54cdac474a57b67cf9bcdb15bcb131d06c (diff)
downloadefi-boot-shim-6df96cdb20b84b33027d2e40bc0dbe0676d31282.tar.gz
efi-boot-shim-6df96cdb20b84b33027d2e40bc0dbe0676d31282.zip
MokManager: fix a wrong allocation failure check.
Signed-off-by: Peter Jones <pjones@redhat.com> Upstream: pr#212
Diffstat (limited to 'MokManager.c')
-rw-r--r--MokManager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/MokManager.c b/MokManager.c
index 654a1150..c9949e33 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -1085,9 +1085,11 @@ static EFI_STATUS write_back_mok_list(MokListNode * list, INTN key_num,
DataSize += sizeof(EFI_GUID);
DataSize += list[i].MokSize;
}
+ if (DataSize == 0)
+ return EFI_SUCCESS;
Data = AllocatePool(DataSize);
- if (Data == NULL && DataSize != 0)
+ if (Data == NULL)
return EFI_OUT_OF_RESOURCES;
ptr = Data;