Re: [PATCH v5] x86/amd_node: Fix resource leak in amd_smn_init() error path
From: Yazen Ghannam
Date: Wed Sep 16 2026 - 13:20:42 EST
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