Skip to content

Commit

Permalink
Prevent oops at boot with VT-d
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Yu Zhao <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dirk Hohndel authored and torvalds committed Jan 13, 2009
1 parent 37a76bd commit 288e487
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 288e487

Please sign in to comment.