pci: off by one in dmar_get_fault_reason()
Subsystems (2)
PATCH 1/1 pci: off by one in dmar_get_fault_reason()
This should be '<' here instead of '<=' so we don't go past the end of the array.
Signed-off-by Dan Carpenter <[email protected]>
drivers/pci/dmar.c +1 -1
@@ -1208,7 +1208,7 @@ static const char *intr_remap_fault_reasons[]const char *dmar_get_fault_reason (u8 fault_reason,int *fault_type) { -if (fault_reason >=0x20 && (fault_reason <=0x20 + +if (fault_reason >=0x20 && (fault_reason <0x20 +ARRAY_SIZE (intr_remap_fault_reasons))) { *fault_type =INTR_REMAP ;return intr_remap_fault_reasons[fault_reason -0x20 ];