diff options
| author | Ernst Sjöstrand <[email protected]> | 2017-11-19 17:52:45 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2017-12-06 17:48:00 +0000 |
| commit | 47e8788b4924b0e3348caf4ad08de5a162bfc4cd (patch) | |
| tree | 5be4edbbf04b699139ddecdfe76da8f2f5be35d0 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | drm/amd/amdgpu: Fix missing null check in atombios_i2c.c (diff) | |
| download | kernel-47e8788b4924b0e3348caf4ad08de5a162bfc4cd.tar.gz kernel-47e8788b4924b0e3348caf4ad08de5a162bfc4cd.zip | |
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 <[email protected]>
Signed-off-by: Ernst Sjöstrand <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions
