drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()
authorjsg <jsg@openbsd.org>
Thu, 14 Apr 2022 08:44:29 +0000 (08:44 +0000)
committerjsg <jsg@openbsd.org>
Thu, 14 Apr 2022 08:44:29 +0000 (08:44 +0000)
From Dan Carpenter
5ba9d78a72948325ecdb4dca2a31a46bc9169574 in linux 5.15.y/5.15.34
1647b54ed55d4d48c7199d439f8834626576cbe9 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_gfx.c

index 7b79c15..c2fa225 100644 (file)
@@ -268,7 +268,7 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
                    * adev->gfx.mec.num_pipe_per_mec
                    * adev->gfx.mec.num_queue_per_pipe;
 
-       while (queue_bit-- >= 0) {
+       while (--queue_bit >= 0) {
                if (test_bit(queue_bit, adev->gfx.mec.queue_bitmap))
                        continue;