mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "João Guilherme da Silva Freitas Lima" <joaoanandalima@gmail.com>,
	linux-efi@vger.kernel.org, "Ard Biesheuvel" <ardb@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] efi: fix memory leak in efi_mem_reserve_iomem()
Date: Sat, 5 Dec 2026 20:20:15 +0100	[thread overview]
Message-ID: <b69a81ba-96f4-40d6-8715-c493bc94e350@web.de> (raw)
In-Reply-To: <20261205184743.1195-1-joaoanandalima@gmail.com>

> Hi efi subsystem,
> 
> I reading the code of efi.c and, is noted a small memory leak:
> 
> In this line:
> 
> 	ret = parent ? request_resource(parent, res) : 0;
> 
> If ret == 0, is success. But, if not is 0 (ret != 0) ?	This patch added a verification 
> to this case, removing res for evits a memory leak and return the ret.

Please refine such a change description.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.4-rc5#n94

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.4-rc5#n145
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.4-rc5#n34


…
+++ b/drivers/firmware/efi/efi.c
…
> @@ -1113,6 +1113,11 @@ static int efi_mem_reserve_iomem(phys_addr_t addr, u64 size)
>  	parent = request_resource_conflict(&iomem_resource, res);
>  	ret = parent ? request_resource(parent, res) : 0;
>  
> +	if (ret) {
…

I suggest to omit a blank line at this source code place.

Regards,
Markus

  reply	other threads:[~2026-12-05 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 18:47 dev12124
2026-12-05 19:20 ` Markus Elfring [this message]
2026-12-06  8:36 ` Markus Elfring

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=b69a81ba-96f4-40d6-8715-c493bc94e350@web.de \
    --to=markus.elfring@web.de \
    --cc=ardb@kernel.org \
    --cc=joaoanandalima@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®