All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pci: off by one in dmar_get_fault_reason()
@ 2010-06-21  6:46 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-06-21  6:46 UTC (permalink / raw)
  To: kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>

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];

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-21  6:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21  6:46 [patch] pci: off by one in dmar_get_fault_reason() Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.