summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2014-08-30 19:51:00 +0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-03 14:38:54 +0400
commit55820e1e840def3802fc366607f2b25e31036ab1 (patch)
tree32b942fb92c24295ea12a11c9945e30c80c07542 /drivers/gpu/drm
parent1ed1ef9dd91ef8067a45889367a888c7494675e0 (diff)
downloadlinux-55820e1e840def3802fc366607f2b25e31036ab1.tar.xz
drm/i915: Don't overrun the intel_wa_regs array
When entering intel_ring_emit_wa() with num_wa_regs equal to I915_MAX_WA_REGS, we end up indexing the intel_wa_regs array beyond its allocation. Fix the check then. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 12135ef36060..96618c0c5085 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -663,7 +663,7 @@ static inline void intel_ring_emit_wa(struct intel_engine_cs *ring,
struct drm_device *dev = ring->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- if (dev_priv->num_wa_regs > I915_MAX_WA_REGS)
+ if (dev_priv->num_wa_regs >= I915_MAX_WA_REGS)
return;
intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));