Skip to content

Commit

Permalink
iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 73f5fc5 ]

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: 695093e ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuan Can authored and gregkh committed Dec 31, 2022
1 parent 6e501b3 commit e42b543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/fsl_pamu.c
Expand Up @@ -865,7 +865,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;
}
}

Expand Down

0 comments on commit e42b543

Please sign in to comment.