All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] iommu: off by one in dmar_get_fault_reason()
@ 2012-05-12 10:59 ` Dan Carpenter
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2012-05-12 10:59 UTC (permalink / raw)
  To: Suresh Siddha
  Cc: Ingo Molnar, Joerg Roedel, Thomas Gleixner, Youquan Song,
	linux-kernel, kernel-janitors

fault_reason = ARRAY_SIZE(irq_remap_fault_reasons) + 0x20 - 0x20 is one
past the end of the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 5ef65cf..9390f3f 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -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];

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-14 13:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-12 10:59 [patch] iommu: off by one in dmar_get_fault_reason() Dan Carpenter
2012-05-12 10:59 ` Dan Carpenter
2012-05-12 12:36 ` walter harms
2012-05-12 12:36   ` walter harms
2012-05-13 17:09   ` [patch v2] " Dan Carpenter
2012-05-13 17:09     ` Dan Carpenter
2012-05-14 13:42     ` [tip:core/iommu] iommu: Fix " tip-bot for Dan Carpenter
2012-05-13 17:12   ` [patch] iommu: " Dan Carpenter
2012-05-13 17:12     ` 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.