summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/dmar.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-01-06 07:18:23 +0100
committerJoerg Roedel <joro@8bytes.org>2014-01-09 12:43:43 +0100
commita84da70b7ba0c5236fccf25115acefc235ed65f9 (patch)
tree906dd550826b135cf122096b0c3079fee9a4ed1d /drivers/iommu/dmar.c
parentiommu/vt-d: fix access after free issue in function free_dmar_iommu() (diff)
downloadlinux-a84da70b7ba0c5236fccf25115acefc235ed65f9.tar.xz
linux-a84da70b7ba0c5236fccf25115acefc235ed65f9.zip
iommu/vt-d: release invalidation queue when destroying IOMMU unit
Release associated invalidation queue when destroying IOMMU unit to avoid memory leak. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/dmar.c')
-rw-r--r--drivers/iommu/dmar.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index b0df78f9cd28..726cfe296d99 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -737,6 +737,12 @@ static void free_iommu(struct intel_iommu *iommu)
destroy_irq(iommu->irq);
}
+ if (iommu->qi) {
+ free_page((unsigned long)iommu->qi->desc);
+ kfree(iommu->qi->desc_status);
+ kfree(iommu->qi);
+ }
+
if (iommu->reg)
unmap_iommu(iommu);