All of lore.kernel.org
 help / color / mirror / Atom feed
From: sudhakar <sudhakar@linux.ibm.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: daniel.kiper@oracle.com, Lidong Chen <lidong.chen@oracle.com>
Subject: Re: [PATCH] loader/i386/pc/linux: Fix resource leak
Date: Tue, 24 Jun 2025 00:27:17 +0530	[thread overview]
Message-ID: <05fe6a2060f841fdc1ace2ca6f58ff1d@linux.ibm.com> (raw)
In-Reply-To: <20250623174601.1082626-1-lidong.chen@oracle.com>

On 2025-06-23 23:16, Lidong Chen via Grub-devel wrote:
> In grub_cmd_initrd(), memory is allocated for variable initrd_ctx
> before calling grub_relocator_alloc_chunk_align_safe(). When the
> function call fails, initrd_ctx should be freed before exiting
> grub_cmd_initrd().
> 
> Fixes: CID 473852
> 
> Signed-off-by: Lidong Chen <lidong.chen@oracle.com>

it looks good..

Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>

> ---
>  grub-core/loader/i386/pc/linux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/grub-core/loader/i386/pc/linux.c 
> b/grub-core/loader/i386/pc/linux.c
> index 4adeee9ae..0c2a4ae51 100644
> --- a/grub-core/loader/i386/pc/linux.c
> +++ b/grub-core/loader/i386/pc/linux.c
> @@ -457,7 +457,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__
> ((unused)),
>      err = grub_relocator_alloc_chunk_align_safe (relocator, &ch,
> addr_min, addr_max, size,
>  						 0x1000, GRUB_RELOCATOR_PREFERENCE_HIGH, 0);
>      if (err)
> -      return err;
> +      goto fail;
>      initrd_chunk = get_virtual_current_address (ch);
>      initrd_addr = get_physical_target_address (ch);
>    }

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  reply	other threads:[~2025-06-23 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 17:46 [PATCH] loader/i386/pc/linux: Fix resource leak Lidong Chen via Grub-devel
2025-06-23 18:57 ` sudhakar [this message]
2025-06-26 18:00   ` Daniel Kiper via Grub-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05fe6a2060f841fdc1ace2ca6f58ff1d@linux.ibm.com \
    --to=sudhakar@linux.ibm.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=lidong.chen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.