linux/drivers/gpu/drm/amd
Ernst Sjöstrand 47e8788b49 drm/amd/powerplay: Fix buffer overflows with mc_reg_address
Smatch warned about the following lines:
ci_set_mc_special_registers() error: buffer overflow 'table->mc_reg_address' 16 <= 16
tonga_set_mc_special_registers() error: buffer overflow 'table->mc_reg_address' 16 <= 16

Change the logic to check before access instead of after incrementing.
It's fine if j reaches max after we're done. This allows the last entry
of the array to be filled without an error message for example.
Changed some whitespace to clarify grouping.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-12-06 12:48:00 -05:00
..
acp
amdgpu drm/amd/powerplay: Fix buffer overflows with mc_reg_address 2017-12-06 12:48:00 -05:00
amdkfd Merge tag 'drm-amdkfd-fixes-2017-11-26' of git://people.freedesktop.org/~gabbayo/linux into drm-fixes 2017-12-01 09:14:46 +10:00
display drm: amd: Fix line continuation formats 2017-12-06 12:47:57 -05:00
include drm/amd/powerplay: Fix missing newlines at end of file 2017-12-06 12:47:59 -05:00
lib drm/amd/chash: Fix typo 2017-09-28 16:03:29 -04:00
powerplay drm/amd/powerplay: Fix buffer overflows with mc_reg_address 2017-12-06 12:48:00 -05:00
scheduler drm/amd/scheduler: add WARN_ON for s_fence->parent 2017-12-06 12:47:18 -05:00