diff options
-rw-r--r-- | drivers/iommu/dmar.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 56e1c79dc77f..e531a2b07207 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c | |||
@@ -657,7 +657,12 @@ static void __init dmar_acpi_insert_dev_scope(u8 device_number, | |||
657 | 657 | ||
658 | static int __init dmar_acpi_dev_scope_init(void) | 658 | static int __init dmar_acpi_dev_scope_init(void) |
659 | { | 659 | { |
660 | struct acpi_dmar_andd *andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar); | 660 | struct acpi_dmar_andd *andd; |
661 | |||
662 | if (dmar_tbl == NULL) | ||
663 | return -ENODEV; | ||
664 | |||
665 | andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar); | ||
661 | 666 | ||
662 | while (((unsigned long)andd) < | 667 | while (((unsigned long)andd) < |
663 | ((unsigned long)dmar_tbl) + dmar_tbl->length) { | 668 | ((unsigned long)dmar_tbl) + dmar_tbl->length) { |