Blame SOURCES/0053-MokManager-fix-a-wrong-allocation-failure-check.patch

d84fc6
From 6df96cdb20b84b33027d2e40bc0dbe0676d31282 Mon Sep 17 00:00:00 2001
d84fc6
From: Peter Jones <pjones@redhat.com>
d84fc6
Date: Thu, 23 Jul 2020 19:01:27 -0400
d84fc6
Subject: [PATCH 53/62] MokManager: fix a wrong allocation failure check.
d84fc6
d84fc6
Signed-off-by: Peter Jones <pjones@redhat.com>
d84fc6
Upstream: pr#212
d84fc6
---
d84fc6
 MokManager.c | 4 +++-
d84fc6
 1 file changed, 3 insertions(+), 1 deletion(-)
d84fc6
d84fc6
diff --git a/MokManager.c b/MokManager.c
d84fc6
index 654a115033c..c9949e33bcf 100644
d84fc6
--- a/MokManager.c
d84fc6
+++ b/MokManager.c
d84fc6
@@ -1085,9 +1085,11 @@ static EFI_STATUS write_back_mok_list(MokListNode * list, INTN key_num,
d84fc6
 			DataSize += sizeof(EFI_GUID);
d84fc6
 		DataSize += list[i].MokSize;
d84fc6
 	}
d84fc6
+	if (DataSize == 0)
d84fc6
+		return EFI_SUCCESS;
d84fc6
 
d84fc6
 	Data = AllocatePool(DataSize);
d84fc6
-	if (Data == NULL && DataSize != 0)
d84fc6
+	if (Data == NULL)
d84fc6
 		return EFI_OUT_OF_RESOURCES;
d84fc6
 
d84fc6
 	ptr = Data;
d84fc6
-- 
d84fc6
2.26.2
d84fc6