iommu/amd: Free domain id when free a domain of struct dma_ops_domain
authorBaoquan He <bhe@redhat.com>
Thu, 15 Sep 2016 08:50:52 +0000 (16:50 +0800)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Feb 2017 22:32:52 +0000 (23:32 +0100)
commit c3db901c54466a9c135d1e6e95fec452e8a42666 upstream.

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

Signed-off-by: Baoquan He <bhe@redhat.com>
Fixes: ec487d1a110a ('x86, AMD IOMMU: add domain allocation and deallocation functions')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/iommu/amd_iommu.c

index a3a0567524c75ff65bc939594677264a9cd2d1b3..1c62c248da6a6ed00907414f673eaaee7c424d86 100644 (file)
@@ -1991,6 +1991,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);
 }