]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: fix overflowed array index read warning
authorTim Huang <Tim.Huang@amd.com>
Thu, 25 Apr 2024 05:15:27 +0000 (13:15 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:39 +0000 (11:06 +0200)
[ Upstream commit ebbc2ada5c636a6a63d8316a3408753768f5aa9f ]

Clear overflowed array index read warning by cast operation.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

index 15ee13c3bd9e191e28eba342db182d82606cc654..6976f61be7341d2241bb161f86acb6604db62a2a 100644 (file)
@@ -368,8 +368,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;