mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
iommu: Fix off by one in dmar_get_fault_reason()
fault_reason - 0x20 == ARRAY_SIZE(irq_remap_fault_reasons) is one past the end of the array. Signed-off-by: Dan Carpenter <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Youquan Song <[email protected]> Cc: walter harms <[email protected]> Cc: Suresh Siddha <[email protected]> Cc: <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
c558df4a01
commit
fefe1ed139
1 changed files with 2 additions and 2 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue