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

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