From: Liu Xiang Date: Mon, 16 Sep 2019 13:53:00 +0000 (+0800) Subject: iommu/arm-smmu: Free context bitmap in the err path of arm_smmu_init_domain_context X-Git-Tag: v5.4-rc4~13^2~4^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6db7bfb431220d78e34d2d0afdb7c12683323588;p=users%2Fjedix%2Flinux-maple.git iommu/arm-smmu: Free context bitmap in the err path of arm_smmu_init_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 Signed-off-by: Will Deacon --- diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index b18aac4c105e..7c503a6bc585 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -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);