diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-12-02 05:18:30 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-12-08 05:03:06 -0500 |
commit | 44cd613c0e4cd93079ea2a93aa06649d8ca0830a (patch) | |
tree | 63eb3d5b97569d4db7fa3eb47201d77eaaccaf46 /drivers | |
parent | 5595b528b49a702c0428c0762bab60999648254c (diff) |
intel-iommu: Fix oops with intel_iommu=igfx_off
The hotplug notifier will call find_domain() to see if the device in
question has been assigned an IOMMU domain. However, this should never
be called for devices with a "dummy" domain, such as graphics devices
when intel_iommu=igfx_off is set and the corresponding IOMMU isn't even
initialised. If you do that, it'll oops as it dereferences the (-1)
pointer.
The notifier function should check iommu_no_mapping() for the
device before doing anything else.
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/intel-iommu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 83cabdc118db..e3e84cac0e98 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -3247,6 +3247,9 @@ static int device_notifier(struct notifier_block *nb, | |||
3247 | struct pci_dev *pdev = to_pci_dev(dev); | 3247 | struct pci_dev *pdev = to_pci_dev(dev); |
3248 | struct dmar_domain *domain; | 3248 | struct dmar_domain *domain; |
3249 | 3249 | ||
3250 | if (iommu_no_mapping(dev)) | ||
3251 | return 0; | ||
3252 | |||
3250 | domain = find_domain(pdev); | 3253 | domain = find_domain(pdev); |
3251 | if (!domain) | 3254 | if (!domain) |
3252 | return 0; | 3255 | return 0; |