forked from luck/tmp_suning_uos_patched
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 <dan.carpenter@oracle.com> Cc: Joerg Roedel <joerg.roedel@amd.com> Cc: Youquan Song <youquan.song@intel.com> Cc: walter harms <wharms@bfs.de> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Cc: <stable@kernel.org> Link: http://lkml.kernel.org/r/20120513170938.GA4280@elgon.mountain Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
c558df4a01
commit
fefe1ed139
|
@ -1057,7 +1057,7 @@ 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 +
|
||||
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];
|
||||
|
|
Loading…
Reference in New Issue
Block a user