mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 13:22:55 +00:00
intel-iommu: Fix array overflow
Fix possible array overflow: drivers/pci/intel-iommu.c: In function ¡dmar_get_fault_reason¢: drivers/pci/intel-iommu.c:753: warning: array subscript is above array bounds drivers/pci/intel-iommu.c: In function ¡iommu_page_fault¢: drivers/pci/intel-iommu.c:753: warning: array subscript is above array bounds Signed-off-by: Takashi Iwai <tiwai@suse.de> Cc: Mark Gross <mgross@linux.intel.com> Acked-by: "Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f664f1f9b7
commit
10e27ed4ba
@ -749,8 +749,8 @@ static char *fault_reason_strings[] =
|
|||||||
|
|
||||||
char *dmar_get_fault_reason(u8 fault_reason)
|
char *dmar_get_fault_reason(u8 fault_reason)
|
||||||
{
|
{
|
||||||
if (fault_reason > MAX_FAULT_REASON_IDX)
|
if (fault_reason >= MAX_FAULT_REASON_IDX)
|
||||||
return fault_reason_strings[MAX_FAULT_REASON_IDX];
|
return fault_reason_strings[MAX_FAULT_REASON_IDX - 1];
|
||||||
else
|
else
|
||||||
return fault_reason_strings[fault_reason];
|
return fault_reason_strings[fault_reason];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user