diff mbox series

[next] platform/x86/amd/pmc: fix leak in probe()

Message ID 65e2fffb-a1cb-4297-b725-661d6b790a05@stanley.mountain (mailing list archive)
State Accepted, archived
Headers show
Series [next] platform/x86/amd/pmc: fix leak in probe() | expand

Commit Message

Dan Carpenter March 12, 2025, 8:31 a.m. UTC
Call pci_dev_put(rdev) before returning.

Fixes: 6ad1b2dc0f2a ("platform/x86/amd/pmc: Use managed APIs for mutex")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/platform/x86/amd/pmc/pmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ilpo Järvinen March 13, 2025, 1 p.m. UTC | #1
On Wed, 12 Mar 2025 11:31:57 +0300, Dan Carpenter wrote:

> Call pci_dev_put(rdev) before returning.
> 
> 


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.

The list of commits applied:
[1/1] platform/x86/amd/pmc: fix leak in probe()
      commit: 01db3d1ff43aeedeaf11c8bc9d09493ec00c8f4a

--
 i.
diff mbox series

Patch

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);