public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] efi: fix an error code
@ 2016-10-13  8:51 Dan Carpenter
  2016-10-13 10:59 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-10-13  8:51 UTC (permalink / raw)
  To: Matt Fleming, Octavian Purdila
  Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

We should return -ENOMEM here, instead of success.

Fixes: 475fb4e8b2f4 ('efi / ACPI: load SSTDs from EFI variables')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 1ac199c..a4944e2 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -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) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] efi: fix an error code
  2016-10-13  8:51 [patch] efi: fix an error code Dan Carpenter
@ 2016-10-13 10:59 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2016-10-13 10:59 UTC (permalink / raw)
  To: Dan Carpenter, Matt Fleming
  Cc: Octavian Purdila, linux-efi@vger.kernel.org, kernel-janitors

On 13 October 2016 at 09:51, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We should return -ENOMEM here, instead of success.
>
> Fixes: 475fb4e8b2f4 ('efi / ACPI: load SSTDs from EFI variables')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 1ac199c..a4944e2 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -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) {
> --
> To unsubscribe from this list: send the line "unsubscribe linux-efi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-13 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13  8:51 [patch] efi: fix an error code Dan Carpenter
2016-10-13 10:59 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox