drm/radeon/kms/atom: fix handling of FB scratch indices
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Oct 2011 00:10:05 +0000 (20:10 -0400)
committerDave Airlie <airlied@redhat.com>
Wed, 19 Oct 2011 08:47:47 +0000 (09:47 +0100)
FB scratch indices are dword indices, but we were treating
them as byte indices.  As such, we were getting the wrong
FB scratch data for non-0 indices.  Fix the indices and
guard the indexing against indices larger than the scratch
allocation.

Fixes memory corruption on some boards if data was written
past the end of the FB scratch array.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>

No differences found