Skip to content

Commit 8b2faf1

Browse files
Bob Zhoualexdeucher
authored andcommitted
drm/amdgpu: add error handle to avoid out-of-bounds
if the sdma_v4_0_irq_id_to_seq return -EINVAL, the process should be stop to avoid out-of-bounds read, so directly return -EINVAL. Signed-off-by: Bob Zhou <bob.zhou@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Le Ma <le.ma@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 2e55bcf commit 8b2faf1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,6 +2021,9 @@ static int sdma_v4_0_process_trap_irq(struct amdgpu_device *adev,
20212021

20222022
DRM_DEBUG("IH: SDMA trap\n");
20232023
instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
2024+
if (instance < 0)
2025+
return instance;
2026+
20242027
switch (entry->ring_id) {
20252028
case 0:
20262029
amdgpu_fence_process(&adev->sdma.instance[instance].ring);

0 commit comments

Comments
 (0)