diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 5ef65cf661528b4408e4d4d620af02918985253a..3a74e4410fc0737d47e1f294378fdb7dc07e27ad 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1057,8 +1057,8 @@ static const char *irq_remap_fault_reasons[] = const char *dmar_get_fault_reason(u8 fault_reason, int *fault_type) { - if (fault_reason >= 0x20 && (fault_reason <= 0x20 + - ARRAY_SIZE(irq_remap_fault_reasons))) { + if (fault_reason >= 0x20 && (fault_reason - 0x20 < + ARRAY_SIZE(irq_remap_fault_reasons))) { *fault_type = INTR_REMAP; return irq_remap_fault_reasons[fault_reason - 0x20]; } else if (fault_reason < ARRAY_SIZE(dma_remap_fault_reasons)) {