aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/dmar.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 142650e82979..f445c10df8df 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -662,10 +662,9 @@ static int __init dmar_acpi_dev_scope_init(void)
662 if (dmar_tbl == NULL) 662 if (dmar_tbl == NULL)
663 return -ENODEV; 663 return -ENODEV;
664 664
665 andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar); 665 for (andd = (void *)dmar_tbl + sizeof(struct acpi_table_dmar);
666 666 ((unsigned long)andd) < ((unsigned long)dmar_tbl) + dmar_tbl->length;
667 while (((unsigned long)andd) < 667 andd = ((void *)andd) + andd->header.length) {
668 ((unsigned long)dmar_tbl) + dmar_tbl->length) {
669 if (andd->header.type == ACPI_DMAR_TYPE_ANDD) { 668 if (andd->header.type == ACPI_DMAR_TYPE_ANDD) {
670 acpi_handle h; 669 acpi_handle h;
671 struct acpi_device *adev; 670 struct acpi_device *adev;
@@ -685,7 +684,6 @@ static int __init dmar_acpi_dev_scope_init(void)
685 } 684 }
686 dmar_acpi_insert_dev_scope(andd->device_number, adev); 685 dmar_acpi_insert_dev_scope(andd->device_number, adev);
687 } 686 }
688 andd = ((void *)andd) + andd->header.length;
689 } 687 }
690 return 0; 688 return 0;
691} 689}