aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-02-19 14:07:22 +0800
committerJoerg Roedel <joro@8bytes.org>2014-03-04 17:50:59 +0100
commit816997d03bca9fabcee65f3481eb0297103eceb7 (patch)
tree73c64708261a149794863fc1fe31ef62e563c8f0 /drivers/iommu/intel-iommu.c
parentiommu/vt-d: Avoid double free of g_iommus on error recovery path (diff)
downloadlinux-dev-816997d03bca9fabcee65f3481eb0297103eceb7.tar.xz
linux-dev-816997d03bca9fabcee65f3481eb0297103eceb7.zip
iommu/vt-d: Avoid caching stale domain_device_info and fix memory leak
Function device_notifier() in intel-iommu.c fails to remove device_domain_info data structures for PCI devices if they are associated with si_domain because iommu_no_mapping() returns true for those PCI devices. This will cause memory leak and caching of stale information in domain->devices list. So fix the issue by not calling iommu_no_mapping() and skipping check of iommu_pass_through. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 52be7555b0df..f75d3aef6de6 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3600,14 +3600,14 @@ static int device_notifier(struct notifier_block *nb,
struct pci_dev *pdev = to_pci_dev(dev);
struct dmar_domain *domain;
- if (iommu_no_mapping(dev))
+ if (iommu_dummy(pdev))
return 0;
domain = find_domain(pdev);
if (!domain)
return 0;
- if (action == BUS_NOTIFY_UNBOUND_DRIVER && !iommu_pass_through) {
+ if (action == BUS_NOTIFY_UNBOUND_DRIVER) {
domain_remove_one_dev_info(domain, pdev);
if (!(domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE) &&