Pablo Greco 11752b
From 46daeedffe98b489014dcdcf14c89438362de7eb Mon Sep 17 00:00:00 2001
Pablo Greco d6c4c4
From: Peter Jones <pjones@redhat.com>
Pablo Greco d6c4c4
Date: Mon, 2 Oct 2017 18:18:30 -0400
Pablo Greco 11752b
Subject: [PATCH] Make get_cert_list() use efi_status_to_str() to print error
Pablo Greco 11752b
 messages.
Pablo Greco d6c4c4
Pablo Greco d6c4c4
Signed-off-by: Peter Jones <pjones@redhat.com>
Pablo Greco 11752b
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Pablo Greco d6c4c4
---
Pablo Greco d6c4c4
 security/integrity/platform_certs/load_uefi.c | 6 ++++--
Pablo Greco d6c4c4
 1 file changed, 4 insertions(+), 2 deletions(-)
Pablo Greco d6c4c4
Pablo Greco d6c4c4
diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
Pablo Greco 11752b
index f0c908241966..4e783f6c6cfb 100644
Pablo Greco d6c4c4
--- a/security/integrity/platform_certs/load_uefi.c
Pablo Greco d6c4c4
+++ b/security/integrity/platform_certs/load_uefi.c
Pablo Greco 11752b
@@ -46,7 +46,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
Pablo Greco 11752b
 		return NULL;
Pablo Greco d6c4c4
 
Pablo Greco 11752b
 	if (*status != EFI_BUFFER_TOO_SMALL) {
Pablo Greco 11752b
-		pr_err("Couldn't get size: 0x%lx\n", *status);
Pablo Greco d6c4c4
+		pr_err("Couldn't get size: %s (0x%lx)\n",
Pablo Greco 11752b
+		       efi_status_to_str(*status), *status);
Pablo Greco 11752b
 		return NULL;
Pablo Greco d6c4c4
 	}
Pablo Greco d6c4c4
 
Pablo Greco 11752b
@@ -57,7 +58,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
Pablo Greco 11752b
 	*status = efi.get_variable(name, guid, NULL, &lsize, db);
Pablo Greco 11752b
 	if (*status != EFI_SUCCESS) {
Pablo Greco d6c4c4
 		kfree(db);
Pablo Greco 11752b
-		pr_err("Error reading db var: 0x%lx\n", *status);
Pablo Greco d6c4c4
+		pr_err("Error reading db var: %s (0x%lx)\n",
Pablo Greco 11752b
+		       efi_status_to_str(*status), *status);
Pablo Greco 11752b
 		return NULL;
Pablo Greco d6c4c4
 	}
Pablo Greco d6c4c4
 
Pablo Greco d6c4c4
-- 
Pablo Greco 11752b
2.24.1
Pablo Greco d6c4c4