diff options
| author | Peter Jones <pjones@redhat.com> | 2020-07-23 19:01:27 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2020-07-23 20:53:24 -0400 |
| commit | 6df96cdb20b84b33027d2e40bc0dbe0676d31282 (patch) | |
| tree | 057067ffa65b1adfbb7011e4949b6c5b8f997d6a /MokManager.c | |
| parent | d3b7dc54cdac474a57b67cf9bcdb15bcb131d06c (diff) | |
| download | efi-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.c | 4 |
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; |
