public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] iommu: off by one in dmar_get_fault_reason()
@ 2012-05-12 10:59 Dan Carpenter
  2012-05-12 12:36 ` walter harms
  0 siblings, 1 reply; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ 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 12:36 ` walter harms
2012-05-13 17:09   ` [patch v2] " Dan Carpenter
2012-05-13 17:12   ` [patch] " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox