[PATCH 3/4] iommu/amd: Free domain id when free a domain of struct dma_ops_domain

From: Baoquan He
Date: Thu Sep 15 2016 - 04:51:16 EST


The current code missed freeing domain id when free a domain of
struct dma_ops_domain.

Signed-off-by: Baoquan He <bhe@xxxxxxxxxx>
---
drivers/iommu/amd_iommu.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 160fc6a..a9f78c2 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1655,6 +1655,9 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)

free_pagetable(&dom->domain);

+ if (dom->domain.id)
+ domain_id_free(dom->domain.id);
+
kfree(dom);
}

--
2.5.5