public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: airlied@linux.ie, linux-pm@lists.linux-foundation.org,
	dri-devel@lists.sourceforge.net,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: Re: [PATH] i915: Read outside array bounds
Date: Tue, 28 Jul 2009 14:50:03 -0700	[thread overview]
Message-ID: <20090728145003.be5399d1.akpm@linux-foundation.org> (raw)
In-Reply-To: <4A6B8C3E.7060501@gmail.com>

(cc jbarnes)

On Sun, 26 Jul 2009 00:50:38 +0200
Roel Kluin <roel.kluin@gmail.com> wrote:

> dev_priv->saveSWF1 is a 16 element array, but this reads up to index 22
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> save_state does not do this addition, can it be removed? please review.
> 
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 9e1d16e..1d04e19 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -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]);

This looks rather correct and the original code looked rather wrong.

Someone please tell me that this might fix one of our splendid number
of i915 bugs :(

  reply	other threads:[~2009-07-28 21:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-25 22:50 [PATH] i915: Read outside array bounds Roel Kluin
2009-07-28 21:50 ` Andrew Morton [this message]
2009-07-29 21:06   ` Rafael J. Wysocki
     [not found]   ` <200907292306.15195.rjw@sisk.pl>
2009-08-02 23:45     ` Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090728145003.be5399d1.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=roel.kluin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox