Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: init return value in amdgpu_ttm_clear_buffer

Otherwise an uninitialized value can be returned if
amdgpu_res_cleared returns true for all regions.

Possibly closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3812

Fixes: a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-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>
(cherry picked from commit 7c62aacc3b452f73a1284198c81551035fac6d71)
Cc: stable@vger.kernel.org

authored by

Pierre-Eric Pelloux-Prayer and committed by
Alex Deucher
d3c7059b 4de141b8

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 2281 2281 struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring; 2282 2282 struct amdgpu_res_cursor cursor; 2283 2283 u64 addr; 2284 - int r; 2284 + int r = 0; 2285 2285 2286 2286 if (!adev->mman.buffer_funcs_enabled) 2287 2287 return -EINVAL;