[patch] pci: off by one in dmar_get_fault_reason()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This should be '<' here instead of '<=' so we don't go past the end of
the array.

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 0a19708..3043636 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -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];
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux