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

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