Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 528af1e1 authored by Jeremy Gebben's avatar Jeremy Gebben Committed by David Keitel
Browse files

iommu/arm-smmu: fix arm_smmu_attach_dynamic error path



Call the correct function to free the io_pgtable_ops when
there is an error.

Change-Id: Ib01041f874a203b18265b46b56b375c76c0ab211
Signed-off-by: default avatarJeremy Gebben <jgebben@codeaurora.org>
parent ddd84602
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1685,7 +1685,7 @@ static int arm_smmu_attach_dynamic(struct iommu_domain *domain,
	int ret;
	struct arm_smmu_domain *smmu_domain = domain->priv;
	enum io_pgtable_fmt fmt;
	struct io_pgtable_ops *pgtbl_ops;
	struct io_pgtable_ops *pgtbl_ops = NULL;
	struct arm_smmu_cfg *cfg = &smmu_domain->cfg;

	if (!(smmu->options & ARM_SMMU_OPT_DYNAMIC)) {
@@ -1752,7 +1752,7 @@ static int arm_smmu_attach_dynamic(struct iommu_domain *domain,
	ret = 0;
out:
	if (ret)
		kfree(pgtbl_ops);
		free_io_pgtable_ops(pgtbl_ops);
	mutex_unlock(&smmu->attach_lock);

	return ret;