From 7eb682444397174b8800ab7d9df9c42e4faafe09 Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Mon, 6 Jan 2014 14:18:23 +0800 Subject: [PATCH] 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 Signed-off-by: Joerg Roedel --- drivers/iommu/dmar.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.5