]> git.hungrycats.org Git - linux/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Nov 2016 09:51:49 +0000 (10:51 +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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/amd_iommu.c

index 96de97a460791ae70efa8f6b0ff91e736363c5e9..822fc4afad3c7e5e8306b36212be49dc2f23c153 100644 (file)
@@ -1654,6 +1654,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);
 }