mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
drm/amdgpu: Fix out-of-bounds write warning
[ Upstream commit be1684930f
]
Check the ring type value to fix the out-of-bounds
write warning
Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f71ef2bb69
commit
a60d1f7ff6
|
@ -352,7 +352,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
|
||||||
ring->max_dw = max_dw;
|
ring->max_dw = max_dw;
|
||||||
ring->hw_prio = hw_prio;
|
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;
|
hw_ip = ring->funcs->type;
|
||||||
num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
|
num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
|
||||||
adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
|
adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user