diff options
| author | Jesse Zhang <[email protected]> | 2025-04-11 08:22:27 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2025-04-11 21:02:17 +0000 |
| commit | cf93f10101f958a95023ed1b63d631c8112b17ca (patch) | |
| tree | b1dd4f4a6e958cf912d9a11eddcbf6c82a4da4f6 /drivers/gpu/drm/amd | |
| parent | drm/amdkfd: add smi events for process start and end (diff) | |
| download | kernel-cf93f10101f958a95023ed1b63d631c8112b17ca.tar.gz kernel-cf93f10101f958a95023ed1b63d631c8112b17ca.zip | |
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 <[email protected]>
Signed-off-by: Jesse Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 4fb174863a80..3d319687c1c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -427,7 +427,7 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev, type = AMD_IP_BLOCK_TYPE_SDMA; for (i = 0; i < adev->sdma.num_instances; i++) if (adev->sdma.instance[i].ring.sched.ready && - !adev->gfx.gfx_ring[i].no_user_submission) + !adev->sdma.instance[i].ring.no_user_submission) ++num_rings; ib_start_alignment = 256; ib_size_alignment = 4; |
