drm/amdgpu: Fix off by one in current_memory_partition_show()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 10 Oct 2024 18:35:36 +0000 (21:35 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Oct 2024 15:26:35 +0000 (11:26 -0400)
commit9f7e94af35996effead76ff2837b5ba322e38963
tree57e4801a2d720d80780ca4bbec503c4bc890ddcf
parent336568de918e08c825b3b1cbe2ec809f2fc26d94
drm/amdgpu: Fix off by one in current_memory_partition_show()

The >= ARRAY_SIZE() should be > ARRAY_SIZE() to prevent an out of
bounds read.

Fixes: 012be6f22c01 ("drm/amdgpu: Add sysfs interfaces for NPS mode")
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c