summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGangliang Xie <ganglxie@amd.com>2026-06-23 10:42:19 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-07-01 11:23:47 -0400
commitfa1531170d2c96060478d697fe93f1cafc0e7ddd (patch)
treecf0310b599f508ac5859af20406d50ddb92ccfb8
parent055a40c32f3a2dcd4d1a6f85ff4c231cf35f1b53 (diff)
downloadlinux-stable-fa1531170d2c96060478d697fe93f1cafc0e7ddd.tar.gz
linux-stable-fa1531170d2c96060478d697fe93f1cafc0e7ddd.zip
drm/amdgpu: add check for xcp id
check sel_xcp_id before its use Signed-off-by: Gangliang Xie <ganglxie@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
index cf71b4f55252..7c3e707ff84e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c
@@ -576,6 +576,9 @@ static void amdgpu_xcp_gpu_sched_update(struct amdgpu_device *adev,
{
unsigned int *num_gpu_sched;
+ if (sel_xcp_id >= MAX_XCP || sel_xcp_id == AMDGPU_XCP_NO_PARTITION)
+ return;
+
num_gpu_sched = &adev->xcp_mgr->xcp[sel_xcp_id]
.gpu_sched[ring->funcs->type][ring->hw_prio].num_scheds;
adev->xcp_mgr->xcp[sel_xcp_id].gpu_sched[ring->funcs->type][ring->hw_prio]