drm/i915: Fix read outside array bounds in restoring the SWF10 range.
authorRoel Kluin <roel.kluin@gmail.com>
Sat, 25 Jul 2009 22:50:38 +0000 (00:50 +0200)
committerEric Anholt <eric@anholt.net>
Wed, 5 Aug 2009 18:21:29 +0000 (11:21 -0700)
dev_priv->saveSWF1 is a 16 element array, but this reads up to index 22,
and restored values from the wrong registers.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_suspend.c

index 9e1d16e5c3ead86f0e805f9d72a95eb7be8e293e..1d04e1904ac69c7be338897a71d25900e44927d1 100644 (file)
@@ -598,7 +598,7 @@ int i915_restore_state(struct drm_device *dev)
 
        for (i = 0; i < 16; i++) {
                I915_WRITE(SWF00 + (i << 2), dev_priv->saveSWF0[i]);
-               I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i+7]);
+               I915_WRITE(SWF10 + (i << 2), dev_priv->saveSWF1[i]);
        }
        for (i = 0; i < 3; i++)
                I915_WRITE(SWF30 + (i << 2), dev_priv->saveSWF2[i]);