Skip to contentSkip to conversation

efi: Delete an error message for a failed memory allocation in efivar_init()

PATCH New SF Markus Elfring 1 participant 1 message Feb 13, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: Delete an error message for a failed memory allocation in efivar_init()

From: Markus Elfring <[email protected]>
Date: Tue, 13 Feb 2018 17:28:22 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/firmware/efi/vars.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/firmware/efi/vars.c +1 -3
index 9336ffdf6e2c..ffdbc5bc3c56 100644
@@ -437,10 +437,8 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
 	int err = 0;
 
 	variable_name = kzalloc(variable_name_size, GFP_KERNEL);
-	if (!variable_name) {
-		printk(KERN_ERR "efivars: Memory allocation failed.\n");
+	if (!variable_name)
 		return -ENOMEM;
-	}
 
 	if (down_interruptible(&efivars_lock)) {
 		err = -EINTR;
Signature · 1 line
2.16.1