summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDirk Hohndel <hohndel@linux.intel.com>2009-01-11 15:33:51 +0000
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-13 08:03:46 -0800
commit288e4877f94a3b144aadc206e7796921d02432c1 (patch)
tree468a77a0c6e22a3d1076d2d98c4dde5c3f8a3ebc /drivers
parent37a76bd4f1b716949fc38a6842e89f0ccb8384d0 (diff)
downloadop-kernel-dev-288e4877f94a3b144aadc206e7796921d02432c1.zip
op-kernel-dev-288e4877f94a3b144aadc206e7796921d02432c1.tar.gz
Prevent oops at boot with VT-d
With some broken BIOSs when VT-d is enabled, the data structures are filled incorrectly. This can cause a NULL pointer dereference in very early boot. Signed-off-by: Dirk Hohndel <hohndel@linux.intel.com> Acked-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/intel-iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 235fb7a..3dfecb2 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -438,7 +438,8 @@ static struct intel_iommu *device_to_iommu(u8 bus, u8 devfn)
continue;
for (i = 0; i < drhd->devices_cnt; i++)
- if (drhd->devices[i]->bus->number == bus &&
+ if (drhd->devices[i] &&
+ drhd->devices[i]->bus->number == bus &&
drhd->devices[i]->devfn == devfn)
return drhd->iommu;
OpenPOWER on IntegriCloud