drm/amd/powerplay: avoid out of bounds access on array ps.
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 14 Nov 2016 08:36:08 +0000 (16:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 16 Nov 2016 19:26:17 +0000 (14:26 -0500)
commitda7800a88c5a3b798f763d6f9f343e9a49860c4f
treede398d00481f3a7cfe880359dc774e9c74889e46
parent1da2c326e43b0834105993d13610647337bbad67
drm/amd/powerplay: avoid out of bounds access on array ps.

check array index first and then visit the array.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-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>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c