From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Ilan Bonneau-Zamon <yolezz.secret@gmail.com>
Cc: bp@alien8.0.org, mario.limonciello@amd.com,
linux-kernel@vger.kernel.org,
Ilan Bonneau-Zamon <ilan.bonneauzamon@gmail.com>
Subject: Re: [PATCH v5] x86/amd_node: Fix resource leak in amd_smn_init() error path
Date: Wed, 16 Sep 2026 12:36:18 -0400 [thread overview]
Message-ID: <20260916163618.GA1395@yaz-khff2.amd.com> (raw)
In-Reply-To: <20260916115955.15965-1-ilan.bonneauzamon@gmail.com>
On Wed, Sep 16, 2026 at 01:59:54PM +0200, Ilan Bonneau-Zamon wrote:
> In amd_smn_init(), if an error occurs after reserving PCI config regions,
> the already reserved regions are left allocated.
>
> Unwind the setup properly in reverse order using traditional error labels
> and goto statements, ensuring proper cleanup on error exit paths.
>
What is wrong with keeping these regions reserved?
The goal of reserving the regions is to prevent user space from using
them. Why should this be backed out?
Maybe we should *not* exit if a reservation fails? Rather, we should
unconditionally attempt to reserve all of them, and warn if reservation
fails on a particular device (but continue iterating).
Thanks,
Yazen
prev parent reply other threads:[~2026-09-16 16:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 11:59 Ilan Bonneau-Zamon
2026-09-16 16:36 ` Yazen Ghannam [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=20260916163618.GA1395@yaz-khff2.amd.com \
--to=yazen.ghannam@amd.com \
--cc=bp@alien8.0.org \
--cc=ilan.bonneauzamon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=yolezz.secret@gmail.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 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®