Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/amdgpu: Fix out of bounds warning in amdgpu_hw_ip_info

Fix an array index out of bounds warning in the DMA IP case of
amdgpu_hw_ip_info() where it was incorrectly checking
adev->gfx.gfx_ring[i].no_user_submission instead of
adev->sdma.instance[i].ring.no_user_submission.

The mismatch caused UBSAN to report an array bounds violation since
it was accessing the GFX ring array with SDMA instance indices.

Fixes: 4310acd4464b ("drm/amdgpu: add ring flag for no user submissions")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jesse Zhang and committed by
Alex Deucher
cf93f101 4172b556

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
··· 427 427 type = AMD_IP_BLOCK_TYPE_SDMA; 428 428 for (i = 0; i < adev->sdma.num_instances; i++) 429 429 if (adev->sdma.instance[i].ring.sched.ready && 430 - !adev->gfx.gfx_ring[i].no_user_submission) 430 + !adev->sdma.instance[i].ring.no_user_submission) 431 431 ++num_rings; 432 432 ib_start_alignment = 256; 433 433 ib_size_alignment = 4;