[patch v2] drm/amdgpu: missing bounds check in amdgpu_set_pp_force_state()

2016-06-17 Thread Alex Deucher
On Thu, Jun 16, 2016 at 4:39 AM, Christian König wrote: > Am 16.06.2016 um 10:30 schrieb Dan Carpenter: >> >> There is no limit on high "idx" can go. It should be less than >> ARRAY_SIZE(data.states) which is 16. >> >> The "data" variable wasn't declared in that scope so I shifted the code >> ar

[patch v2] drm/amdgpu: missing bounds check in amdgpu_set_pp_force_state()

2016-06-16 Thread Dan Carpenter
There is no limit on high "idx" can go. It should be less than ARRAY_SIZE(data.states) which is 16. The "data" variable wasn't declared in that scope so I shifted the code around a bit to make it work. Also I made "idx" unsigned. Fixes: f3898ea12fc1 ('drm/amd/powerplay: add some sysfs interface

[patch v2] drm/amdgpu: missing bounds check in amdgpu_set_pp_force_state()

2016-06-16 Thread Christian König
Am 16.06.2016 um 10:30 schrieb Dan Carpenter: > There is no limit on high "idx" can go. It should be less than > ARRAY_SIZE(data.states) which is 16. > > The "data" variable wasn't declared in that scope so I shifted the code > around a bit to make it work. Also I made "idx" unsigned. > > Fixes: