drm/amdgpu: init return value in amdgpu_ttm_clear_buffer
Subsystems (2)
PATCH 1/1 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.
Fixes a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")
Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -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 ;
Signature · 1 line
2.43.0
Quoted 6 lines · Pierre-Eric Pelloux-Prayer
Otherwise an uninitialized value can be returned if
amdgpu_res_clearedreturns true for all regions.Fixes a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>
Acked-by Alex Deucher <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2@@ -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
Am 21.02.25 um 16:16 schrieb Alex Deucher:
Quoted 8 lines
Quoted 5 lines · Pierre-Eric Pelloux-Prayer
Otherwise an uninitialized value can be returned if
amdgpu_res_clearedreturns true for all regions.Fixes a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>Acked-by Alex Deucher <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 21 lines
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2@@ -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
Quoted 5 lines · Pierre-Eric Pelloux-Prayer
Otherwise an uninitialized value can be returned if
amdgpu_res_clearedreturns true for all regions.Fixes a68c7eaa7a8f ("drm/amdgpu: Enable clear page functionality")
Possibly closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3812
Quoted 21 lines
Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-2@@ -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