[PATCH] drm/amdgpu: fix overflowed array index read warning
Christian König
ckoenig.leichtzumerken at gmail.com
Fri Apr 26 07:24:27 UTC 2024
Am 26.04.24 um 02:27 schrieb Tim Huang:
> Clear overflowed array index read warning by cast operation.
>
> Signed-off-by: Tim Huang <Tim.Huang at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 06f0a6534a94..15c240656470 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -473,8 +473,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;
More information about the amd-gfx
mailing list