diff options
| author | Ma Jun <[email protected]> | 2024-04-25 06:00:17 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-05-08 19:17:05 +0000 |
| commit | be1684930f5262a622d40ce7a6f1423530d87f89 (patch) | |
| tree | 1bb7ea659489f430d1b0998e70f90951fe14577f /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
| parent | drm/amd/amdxcp: Fix warnings (diff) | |
| download | kernel-be1684930f5262a622d40ce7a6f1423530d87f89.tar.gz kernel-be1684930f5262a622d40ce7a6f1423530d87f89.zip | |
drm/amdgpu: Fix out-of-bounds write warning
Check the ring type value to fix the out-of-bounds
write warning
Signed-off-by: Ma Jun <[email protected]>
Suggested-by: Christian König <[email protected]>
Reviewed-by: Tim Huang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index 15c240656470..ad49cecb20b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -352,7 +352,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->max_dw = max_dw; ring->hw_prio = hw_prio; - if (!ring->no_scheduler) { + if (!ring->no_scheduler && ring->funcs->type < AMDGPU_HW_IP_NUM) { hw_ip = ring->funcs->type; num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds; adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] = |
