Skip to content

Commit ccb32e2

Browse files
Yuuoniyjwrdegoede
authored andcommitted
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: 3d7d407 ("platform/x86: amd-pmc: Add support for AMD Spill to DRAM STB feature") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20221229072534.1381432-1-linmq006@gmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 6aa5207 commit ccb32e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/platform/x86/amd

drivers/platform/x86/amd/pmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
932932
if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB)) {
933933
err = amd_pmc_s2d_init(dev);
934934
if (err)
935-
return err;
935+
goto err_pci_dev_put;
936936
}
937937

938938
platform_set_drvdata(pdev, dev);

0 commit comments

Comments
 (0)