diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-06-08 10:20:23 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-06-08 10:20:22 -0700 |
| commit | 59f6052a9d7bc2c7aa2ff1dd08d6c92a5c8f7ae3 (patch) | |
| tree | 859ed8f6b8080237d21d2db188f1c4652954648a | |
| parent | 7ae0b636e93d11cca7bdf40d3b816ab6d513e763 (diff) | |
| parent | 528c99691b4ec6180be29418c2e89e59199e7aa3 (diff) | |
Merge "ARM: SMMU: clear page table ops of attached device"
| -rw-r--r-- | drivers/iommu/arm-smmu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 6317478916ef..56f2980adc28 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2256,8 +2256,17 @@ static int arm_smmu_attach_dynamic(struct iommu_domain *domain, smmu_domain->pgtbl_ops = pgtbl_ops; ret = 0; out: - if (ret) + if (ret) { free_io_pgtable_ops(pgtbl_ops); + /* unassign any freed page table memory */ + if (arm_smmu_is_master_side_secure(smmu_domain)) { + arm_smmu_secure_domain_lock(smmu_domain); + arm_smmu_secure_pool_destroy(smmu_domain); + arm_smmu_unassign_table(smmu_domain); + arm_smmu_secure_domain_unlock(smmu_domain); + } + smmu_domain->pgtbl_ops = NULL; + } mutex_unlock(&smmu->attach_lock); return ret; |
