Skip to content

Commit

Permalink
iommu/arm-smmu: Free context bitmap in the err path of arm_smmu_init_…
Browse files Browse the repository at this point in the history
…domain_context

When alloc_io_pgtable_ops is failed, context bitmap which is just allocated
by __arm_smmu_alloc_bitmap should be freed to release the resource.

Signed-off-by: Liu Xiang <liuxiang_1999@126.com>
Signed-off-by: Will Deacon <will@kernel.org>
  • Loading branch information
feixiang1999 authored and willdeacon committed Oct 1, 2019
1 parent 54ecb8f commit 6db7bfb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iommu/arm-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
return 0;

out_clear_smmu:
__arm_smmu_free_bitmap(smmu->context_map, cfg->cbndx);
smmu_domain->smmu = NULL;
out_unlock:
mutex_unlock(&smmu_domain->init_mutex);
Expand Down

0 comments on commit 6db7bfb

Please sign in to comment.