Skip to contentSkip to conversation

efi: fix an error code

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 13, 2016

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

PATCH 1/1 efi: fix an error code

We should return -ENOMEM here, instead of success.

Fixes 475fb4e8b2f4 ('efi / ACPI: load SSTDs from EFI variables')
drivers/firmware/efi/efi.c +3 -1
index 1ac199c..a4944e2 100644
@@ -259,8 +259,10 @@ static __init int efivar_ssdt_load(void)
 		}
 
 		data = kmalloc(size, GFP_KERNEL);
-		if (!data)
+		if (!data) {
+			ret = -ENOMEM;
 			goto free_entry;
+		}
 
 		ret = efivar_entry_get(entry, NULL, &size, data);
 		if (ret) {
#1 lore raw
Quoted 22 lines · Dan Carpenter

We should return -ENOMEM here, instead of success.

Fixes 475fb4e8b2f4 ('efi / ACPI: load SSTDs from EFI variables')
drivers/firmware/efi/efi.c +3 -2
index 1ac199c..a4944e2 100644
@@ -259,8 +259,10 @@ static __init int efivar_ssdt_load(void)
                }
 
                data = kmalloc(size, GFP_KERNEL);
-               if (!data)
+               if (!data) {
+                       ret = -ENOMEM;
                        goto free_entry;
+               }
 
                ret = efivar_entry_get(entry, NULL, &size, data);
                if (ret) {
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied, thanks.