Skip to content

Commit

Permalink
drm/amdgpu: fix overflowed array index read warning
Browse files Browse the repository at this point in the history
[ Upstream commit ebbc2ad ]

Clear overflowed array index read warning by cast operation.

Signed-off-by: Tim Huang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Tim Huang authored and gregkh committed Sep 8, 2024
1 parent d2fe7ac commit da22d1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit da22d1b

Please sign in to comment.