drm/amd/amdgpu: Fix GPR read from debugfs (v2)
authorTom St Denis <tom.stdenis@amd.com>
Tue, 10 Mar 2020 12:40:41 +0000 (08:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2020 07:06:12 +0000 (08:06 +0100)
commit053a9862f0202cdcda9c56778dd98396a7cb3513
tree1a5a0ea9ca68128822255bf97872d1c223576200
parent221ab6a9e6a105ab17200ae7a22c68f8451bf044
drm/amd/amdgpu: Fix GPR read from debugfs (v2)

commit 5bbc6604a62814511c32f2e39bc9ffb2c1b92cbe upstream.

The offset into the array was specified in bytes but should
be in terms of 32-bit words.  Also prevent large reads that
would also cause a buffer overread.

v2:  Read from correct offset from internal storage buffer.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c