Index: head/sys/x86/iommu/intel_fault.c =================================================================== --- head/sys/x86/iommu/intel_fault.c +++ head/sys/x86/iommu/intel_fault.c @@ -291,12 +291,12 @@ dmar_fini_fault_log(struct dmar_unit *unit) { + if (unit->fault_taskqueue == NULL) + return; + DMAR_LOCK(unit); dmar_disable_fault_intr(unit); DMAR_UNLOCK(unit); - - if (unit->fault_taskqueue == NULL) - return; taskqueue_drain(unit->fault_taskqueue, &unit->fault_task); taskqueue_free(unit->fault_taskqueue); Index: head/sys/x86/iommu/intel_gas.c =================================================================== --- head/sys/x86/iommu/intel_gas.c +++ head/sys/x86/iommu/intel_gas.c @@ -546,7 +546,7 @@ return (EBUSY); entry->start = prev->end; } - if (next != NULL && next->start < entry->end && + if (next->start < entry->end && (next->flags & DMAR_MAP_ENTRY_PLACE) == 0) { if ((next->flags & DMAR_MAP_ENTRY_RMRR) == 0) return (EBUSY); @@ -560,7 +560,7 @@ dmar_gas_rb_remove(domain, prev); prev = NULL; } - if (next != NULL && next->start < entry->end) { + if (next->start < entry->end) { dmar_gas_rb_remove(domain, next); next = NULL; } Index: head/sys/x86/iommu/intel_qi.c =================================================================== --- head/sys/x86/iommu/intel_qi.c +++ head/sys/x86/iommu/intel_qi.c @@ -425,7 +425,7 @@ { struct dmar_qi_genseq gseq; - if (unit->qi_enabled) + if (!unit->qi_enabled) return; taskqueue_drain(unit->qi_taskqueue, &unit->qi_task); taskqueue_free(unit->qi_taskqueue);