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 <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 6aa5207 commit ccb32e2

File tree

1 file changed

+1
-1
lines changed
  • drivers/platform/x86/amd

1 file changed

+1
-1
lines changed

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)