iommu_gas: Correct a broken KASSERT

If iommu_gas_find_space() ever called iommu_gas_uppermatch(), and it
succeeded in allocating space, then the subsequent KASSERT would be
triggered.  Change that KASSERT to accept either success or ENOMEM.

MFC after:	1 week
This commit is contained in:
Alan Cox 2022-06-17 12:03:06 -05:00
parent ad0a7ea650
commit e6775534ae

View File

@ -504,7 +504,7 @@ iommu_gas_find_space(struct iommu_domain *domain,
if (common->highaddr >= domain->end)
return (ENOMEM);
error = iommu_gas_uppermatch(&a, RB_ROOT(&domain->rb_root));
KASSERT(error == ENOMEM,
KASSERT(error == 0 || error == ENOMEM,
("error %d from iommu_gas_uppermatch", error));
return (error);
}