diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -398,16 +398,11 @@ */ entry = first; while (entry != NULL) { - if ((first = RB_LEFT(entry, rb_entry)) != NULL) { - if (first->last >= a->common->lowaddr) { - /* All remaining ranges >= lowaddr */ - break; - } - if (iommu_gas_match_one(a, first->last, entry->start, - a->common->lowaddr)) { - iommu_gas_match_insert(a); - return (0); - } + if ((first = RB_LEFT(entry, rb_entry)) != NULL && + iommu_gas_match_one(a, first->last, entry->start, + a->common->lowaddr)) { + iommu_gas_match_insert(a); + return (0); } if (entry->end >= a->common->lowaddr) { /* All remaining ranges >= lowaddr */