From: Jarkko Sakkinen <jarkko@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: acpi: Fix memory leak at tpm_read_log_acpi() error path
Date: Mon, 9 Nov 2026 18:44:37 +0200 [thread overview]
Message-ID: <avH4dX38CWW3IOAg@kernel.org> (raw)
In-Reply-To: <87mrriuhig.wl-tiwai@suse.de>
On Mon, Nov 09, 2026 at 04:55:03PM +0100, Takashi Iwai wrote:
> On Mon, 09 Nov 2026 16:25:45 +0100,
> Jarkko Sakkinen wrote:
> >
> > On Mon, Nov 09, 2026 at 09:25:24AM +0100, Takashi Iwai wrote:
> > > When devm_add_action() returns an error, we do NULL-clear
> > > log->bios_event_log unnecessarily before calling tpm_bios_log_free(),
> > > and it would lead to a memory leak of the allocated log buffer.
> >
> > I don't understand this. "NULL-clear" is gibberish when the actual
> > bug is just spurious clear of log->bios_event_log.
>
> It's not "spurious", but rather ill-behaving.
> Because it sets NULL before calling tpm_bios_log_free(), the actually
> allocated buffer won't be freed at all.
I agree. That was wrong choice of the word from my side :-)
Since in this case it simple, I'd just want to apples and oranges
pointed out, that's all.
>
>
> Takashi
Br, Jarkko
prev parent reply other threads:[~2026-11-09 16:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 8:25 Takashi Iwai
2026-11-09 15:25 ` Jarkko Sakkinen
2026-11-09 15:26 ` Jarkko Sakkinen
2026-11-09 15:55 ` Takashi Iwai
2026-11-09 16:44 ` Jarkko Sakkinen [this message]
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=avH4dX38CWW3IOAg@kernel.org \
--to=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=tiwai@suse.de \
/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®