From: jsg Date: Mon, 9 Sep 2024 09:16:02 +0000 (+0000) Subject: drm/amdgpu: Fix out-of-bounds write warning X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ebd6dead264f74ed371b05aa604b6bc1c5dcfb3c;p=openbsd drm/amdgpu: Fix out-of-bounds write warning From Ma Jun a60d1f7ff62e453dde2d3b4907e178954d199844 in linux-6.6.y/6.6.50 be1684930f5262a622d40ce7a6f1423530d87f89 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ring.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ring.c index 0bedffc4eb4..f44b303ae28 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ring.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ring.c @@ -352,7 +352,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->max_dw = max_dw; 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; num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds; adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =