Index: sys/arm64/iommu/iommu.c =================================================================== --- sys/arm64/iommu/iommu.c +++ sys/arm64/iommu/iommu.c @@ -212,7 +212,7 @@ return (error); tag = ioctx->tag = malloc(sizeof(struct bus_dma_tag_iommu), - M_IOMMU, M_WAITOK | M_ZERO); + M_DEVBUF, M_WAITOK | M_ZERO); tag->owner = requester; tag->ctx = ioctx; tag->ctx->domain = iodom; @@ -372,20 +372,18 @@ void iommu_free_ctx_locked(struct iommu_unit *iommu, struct iommu_ctx *ioctx) { - struct bus_dma_tag_iommu *tag; + struct iommu_domain *domain; int error; IOMMU_ASSERT_LOCKED(iommu); - tag = ioctx->tag; + domain = ioctx->domain; IOMMU_CTX_FREE(iommu->dev, ioctx); IOMMU_UNLOCK(iommu); - free(tag, M_IOMMU); - /* Since we have a domain per each ctx, remove the domain too. */ - error = iommu_domain_free(ioctx->domain); + error = iommu_domain_free(domain); if (error) device_printf(iommu->dev, "Could not free a domain\n"); }