drm/amdgpu: fix overflowed array index read warning
authorjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 08:27:57 +0000 (08:27 +0000)
committerjsg <jsg@openbsd.org>
Mon, 9 Sep 2024 08:27:57 +0000 (08:27 +0000)
From Tim Huang
da22d1b98d9d3a1bfd62bd291b10d57b0f19d6e5 in linux-6.6.y/6.6.50
ebbc2ada5c636a6a63d8316a3408753768f5aa9f in mainline linux

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

index dbde3b4..0bedffc 100644 (file)
@@ -469,8 +469,9 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf,
                                        size_t size, loff_t *pos)
 {
        struct amdgpu_ring *ring = file_inode(f)->i_private;
-       int r, i;
        uint32_t value, result, early[3];
+       loff_t i;
+       int r;
 
        if (*pos & 3 || size & 3)
                return -EINVAL;