Re: [PATCH] platform/x86/amd/hfi: fix platform device leak on init failure
From: Ilpo Järvinen
Date: Fri Oct 09 2026 - 06:29:21 EST
On Thu, 8 Oct 2026, Mario Limonciello wrote:
>
>
> On 10/8/26 12:37, Ilpo Järvinen wrote:
> > On Mon, 21 Sep 2026 16:26:09 +0800, Guangshuo Li wrote:
> >
> > > amd_hfi_init() registers the HFI platform device before registering
> > > the platform driver. If platform_driver_register() fails, the function
> > > returns the error without unregistering the already registered platform
> > > device.
> > >
> > > Since the failed init path does not run amd_hfi_exit(), the platform
> > > device remains registered and its reference is never dropped, preventing
> > > the associated platform object from being released.
> > >
> > > [...]
> >
> > Thank you for your contribution, it has been applied to my local
> > review-ilpo-next branch. Note it will show up in the public
> > platform-drivers-x86/review-ilpo-next branch only once I've pushed my
> > local branch there, which might take a while.
> >
> > FYI [if applicable to your patch], as per Linus' policy change, also
> > fixes are mostly routed through for-next unless the fix is for a
> > commit introduced in the most recent cycle or is clearly a regression
> > fix.
> >
> > The list of commits applied:
> > [1/1] platform/x86/amd/hfi: fix platform device leak on init failure
> > commit: a15d58ff15a6ede327e3814c791c6912b973e434
> >
> > --
> > i.
>
> Hi Ilpo,
>
> Did you see my follow up comment that this patch should be unnecessary?
>
> https://lore.kernel.org/platform-driver-x86/652e3b3b-0f56-4d01-8fd8-e4a9ddedabfe@xxxxxxxxxx/
Ah, now I recall that. I just didn't notice your reply among many useless
replies that this patch happened to trigger while processing the patch
queue.
I've dropped the patch now.
> Basically pointless call torn out by this series:
>
> https://lore.kernel.org/platform-driver-x86/20260921170411.1149960-1-mario.limonciello@xxxxxxx/
I'll get to this, hopefully today (I'm almost done with processing simple
cases from the patch queue).
--
i.