From: Baoquan He Date: Thu, 15 Sep 2016 08:50:52 +0000 (+0800) Subject: iommu/amd: Free domain id when free a domain of struct dma_ops_domain X-Git-Tag: v3.12.68~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fd4c5e383c44934691f1d2fb356a8533591fa8e;p=thirdparty%2Fkernel%2Fstable.git iommu/amd: Free domain id when free a domain of struct dma_ops_domain commit c3db901c54466a9c135d1e6e95fec452e8a42666 upstream. The current code missed freeing domain id when free a domain of struct dma_ops_domain. Signed-off-by: Baoquan He Fixes: ec487d1a110a ('x86, AMD IOMMU: add domain allocation and deallocation functions') Signed-off-by: Joerg Roedel Signed-off-by: Jiri Slaby --- diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 73353a97aafb9..71f9cd1085905 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2032,6 +2032,9 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom) kfree(dom->aperture[i]); } + if (dom->domain.id) + domain_id_free(dom->domain.id); + kfree(dom); }