aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/amd/pmc/pmc.c
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2025-03-12 08:31:57 +0000
committerIlpo Järvinen <[email protected]>2025-03-13 13:00:33 +0000
commit01db3d1ff43aeedeaf11c8bc9d09493ec00c8f4a (patch)
tree9707b5f87d2f03c97dfb69a871d9dc4fc3af0d80 /drivers/platform/x86/amd/pmc/pmc.c
parentMerge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into ... (diff)
downloadkernel-01db3d1ff43aeedeaf11c8bc9d09493ec00c8f4a.tar.gz
kernel-01db3d1ff43aeedeaf11c8bc9d09493ec00c8f4a.zip
platform/x86/amd/pmc: fix leak in probe()
Call pci_dev_put(rdev) before returning. Fixes: 6ad1b2dc0f2a ("platform/x86/amd/pmc: Use managed APIs for mutex") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/amd/pmc/pmc.c')
-rw-r--r--drivers/platform/x86/amd/pmc/pmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 84bc47009e5f..d789d6cab794 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -785,7 +785,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
err = devm_mutex_init(dev->dev, &dev->lock);
if (err)
- return err;
+ goto err_pci_dev_put;
/* Get num of IP blocks within the SoC */
amd_pmc_get_ip_info(dev);