OSDN Git Service

iommu/arm-smmu: fix arm_smmu_attach_dynamic error path
authorJeremy Gebben <jgebben@codeaurora.org>
Thu, 20 Aug 2015 18:49:02 +0000 (12:49 -0600)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:13:59 +0000 (11:13 -0700)
Call the correct function to free the io_pgtable_ops when
there is an error.

Change-Id: Ib01041f874a203b18265b46b56b375c76c0ab211
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
drivers/iommu/arm-smmu.c

index ca41bc3..4a188b0 100644 (file)
@@ -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;