diff options
| author | Lijo Lazar <lijo.lazar@amd.com> | 2026-06-18 10:45:10 +0530 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-07-01 11:11:17 -0400 |
| commit | 7445035dd3f22fc4c151058304b2dc6df4aca59b (patch) | |
| tree | 6f4d81c7945b66db261b8312425609a8ee6a09a6 | |
| parent | fed5bdbfe1d4a19a26c70f7fc58017dc88be1c18 (diff) | |
| download | linux-stable-7445035dd3f22fc4c151058304b2dc6df4aca59b.tar.gz linux-stable-7445035dd3f22fc4c151058304b2dc6df4aca59b.zip | |
drm/amdgpu: bounds check xcp ip block index
Check out of range values for ip block.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c index 9202ddf3d69c..c6b43353e08e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c @@ -381,7 +381,8 @@ int amdgpu_xcp_get_inst_details(struct amdgpu_xcp *xcp, enum AMDGPU_XCP_IP_BLOCK ip, uint32_t *inst_mask) { - if (!xcp->valid || !inst_mask || !(xcp->ip[ip].valid)) + if (!xcp->valid || !inst_mask || ip >= AMDGPU_XCP_MAX_BLOCKS || + !(xcp->ip[ip].valid)) return -EINVAL; *inst_mask = xcp->ip[ip].inst_mask; |
