aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/dmar.c
diff options
context:
space:
mode:
authorTroy Heber <troy.heber@hp.com>2009-08-19 17:26:11 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-08-30 14:05:04 -0400
commit8211a7b5857914058c52ae977c96463e419b37ab (patch)
tree3a3d61d43dd08892d0d1bb1ffa8dc635f634b31e /drivers/pci/dmar.c
parent2ff729f5445cc47d1910386c36e53fc6b1c5e47a (diff)
pci/dmar: correct off-by-one error in dmar_fault()
DMAR faults are recorded into a ring of "fault recording registers". fault_index is a 0-based index into the ring. The code allows the 0-based fault_index to be equal to the total number of fault registers available from the cap_num_fault_regs() macro, which causes access beyond the last available register. Signed-off-by Troy Heber <troy.heber@hp.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/dmar.c')
-rw-r--r--drivers/pci/dmar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 380b60e677e0..3264b626725a 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -1226,7 +1226,7 @@ irqreturn_t dmar_fault(int irq, void *dev_id)
1226 source_id, guest_addr); 1226 source_id, guest_addr);
1227 1227
1228 fault_index++; 1228 fault_index++;
1229 if (fault_index > cap_num_fault_regs(iommu->cap)) 1229 if (fault_index >= cap_num_fault_regs(iommu->cap))
1230 fault_index = 0; 1230 fault_index = 0;
1231 spin_lock_irqsave(&iommu->register_lock, flag); 1231 spin_lock_irqsave(&iommu->register_lock, flag);
1232 } 1232 }