iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()
authorYuan Can <yuancan@huawei.com>
Mon, 21 Nov 2022 08:20:22 +0000 (08:20 +0000)
committerJoerg Roedel <jroedel@suse.de>
Tue, 22 Nov 2022 14:51:31 +0000 (15:51 +0100)
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.")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221121082022.19091-1-yuancan@huawei.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/fsl_pamu.c

index 1b53d2da2c191a784505d7d3fff3292e68593590..1a8c85d54123f80d4c707324963f38ec885f0fa5 100644 (file)
@@ -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 error;
                }
        }