[PATCH v1] drm/amdgpu: init return value in amdgpu_ttm_clear_buffer
Alex Deucher
alexdeucher at gmail.com
Fri Feb 21 22:01:41 UTC 2025
On Fri, Feb 21, 2025 at 10:13 AM Pierre-Eric Pelloux-Prayer
<pierre-eric.pelloux-prayer at amd.com> wrote:
>
> Otherwise an uninitialized value can be returned if
> amdgpu_res_cleared returns true for all regions.
>
> Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")
Possibly closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3812
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index a30985c8f539..e8d7c23f22c6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2295,7 +2295,7 @@ int amdgpu_ttm_clear_buffer(struct amdgpu_bo *bo,
> struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
> struct amdgpu_res_cursor cursor;
> u64 addr;
> - int r;
> + int r = 0;
>
> if (!adev->mman.buffer_funcs_enabled)
> return -EINVAL;
> --
> 2.43.0
>
More information about the amd-gfx
mailing list