]> git.ipfire.org Git - thirdparty/kernel/stable.git/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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 24 Nov 2016 15:23:47 +0000 (16:23 +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: Jiri Slaby <jslaby@suse.cz>
drivers/iommu/amd_iommu.c

index 73353a97aafb9a53c4afd003e723868014aad3a8..71f9cd1085905bd702e365b9f5ba2df771fa3c81 100644 (file)
@@ -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);
 }