Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 819e0064 authored by Roel Kluin's avatar Roel Kluin Committed by Eric Anholt
Browse files

drm/i915: Fix read outside array bounds in restoring the SWF10 range.



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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent 9c9fe1f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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]);