Skip to contentSkip to conversation

iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()

PATCH Applied Yuan Can 2 participants 2 messages Nov 21, 2022 – Nov 22, 2022 IOMMU

lore
Share & tools
lore

Yuan Can

author
#0 lore raw

PATCH 1/1 iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()

The fsl_pamu_probe() returns directly when create_csd() failed, leaving irq and memories unreleased.
Fix by jumping to error if create_csd() returns error.

Fixes 695093e38c3e ("iommu/fsl: Freescale PAMU driver and iommu implementation.")
---
 drivers/iommu/fsl_pamu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/fsl_pamu.c +1 -1
index 0d03f837a5d4..402d14a61141 100644
@@ -868,7 +868,7 @@ static int fsl_pamu_probe(struct platform_device *pdev)
 		ret = create_csd(ppaact_phys, mem_size, csd_port_id);
 		if (ret) {
 			dev_err(dev, "could not create coherence subdomain\n");
-			return ret;
+			goto err;
 		}
 	}
 
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Yuan Can

The fsl_pamu_probe() returns directly when create_csd() failed, leaving irq and memories unreleased.
Fix by jumping to error if create_csd() returns error.

Fixes 695093e38c3e ("iommu/fsl: Freescale PAMU driver and iommu implementation.")
---
 drivers/iommu/fsl_pamu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.