From 528af1e1ce4977a4638539f8bcfb931b839615cd Mon Sep 17 00:00:00 2001 From: Jeremy Gebben Date: Thu, 20 Aug 2015 12:49:02 -0600 Subject: [PATCH] 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: Jeremy Gebben --- drivers/iommu/arm-smmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index ca41bc362895..4a188b092b33 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -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; -- 2.11.0