[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MN0PR12MB6101BA766F292E56092FC7A9E2F49@MN0PR12MB6101.namprd12.prod.outlook.com>
Date: Tue, 3 Jan 2023 02:00:56 +0000
From: "Limonciello, Mario" <Mario.Limonciello@....com>
To: Miaoqian Lin <linmq006@...il.com>,
"S-k, Shyam-sundar" <Shyam-sundar.S-k@....com>,
Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
"Goswami, Sanket" <Sanket.Goswami@....com>,
"platform-driver-x86@...r.kernel.org"
<platform-driver-x86@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] platform/x86/amd: Fix refcount leak in amd_pmc_probe
[Public]
> -----Original Message-----
> From: Miaoqian Lin <linmq006@...il.com>
> Sent: Thursday, December 29, 2022 01:26
> To: S-k, Shyam-sundar <Shyam-sundar.S-k@....com>; Hans de Goede
> <hdegoede@...hat.com>; Mark Gross <markgross@...nel.org>; Goswami,
> Sanket <Sanket.Goswami@....com>; Limonciello, Mario
> <Mario.Limonciello@....com>; platform-driver-x86@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Cc: linmq006@...il.com
> Subject: [PATCH] platform/x86/amd: Fix refcount leak in amd_pmc_probe
>
> pci_get_domain_bus_and_slot() takes reference, the caller should release
> the reference by calling pci_dev_put() after use. Call pci_dev_put() in
> the error path to fix this.
>
> Fixes: 3d7d407dfb05 ("platform/x86: amd-pmc: Add support for AMD Spill to
> DRAM STB feature")
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
Makes sense to me, thanks!
Reviewed-by: Mario Limonciello <mario.limonciello@....com>
> ---
> drivers/platform/x86/amd/pmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/amd/pmc.c
> b/drivers/platform/x86/amd/pmc.c
> index 439d282aafd1..8d924986381b 100644
> --- a/drivers/platform/x86/amd/pmc.c
> +++ b/drivers/platform/x86/amd/pmc.c
> @@ -932,7 +932,7 @@ static int amd_pmc_probe(struct platform_device
> *pdev)
> if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id
> == AMD_CPU_ID_CB)) {
> err = amd_pmc_s2d_init(dev);
> if (err)
> - return err;
> + goto err_pci_dev_put;
> }
>
> platform_set_drvdata(pdev, dev);
> --
> 2.25.1
Powered by blists - more mailing lists