mirror of
https://github.com/torvalds/linux.git
synced 2026-10-13 13:51:03 +02:00
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>
This commit is contained in:
parent
fed5bdbfe1
commit
7445035dd3
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user