Skip to content

Commit 01db3d1

Browse files
Dan Carpenterij-intel
authored andcommitted
platform/x86/amd/pmc: fix leak in probe()
Call pci_dev_put(rdev) before returning. Fixes: 6ad1b2d ("platform/x86/amd/pmc: Use managed APIs for mutex") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/65e2fffb-a1cb-4297-b725-661d6b790a05@stanley.mountain Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent f895f24 commit 01db3d1

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

drivers/platform/x86/amd/pmc/pmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
785785

786786
err = devm_mutex_init(dev->dev, &dev->lock);
787787
if (err)
788-
return err;
788+
goto err_pci_dev_put;
789789

790790
/* Get num of IP blocks within the SoC */
791791
amd_pmc_get_ip_info(dev);

0 commit comments

Comments
 (0)