From: Dan Carpenter Date: Wed, 9 Aug 2017 10:30:46 +0000 (+0300) Subject: drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind() X-Git-Tag: MMI-PSA29.97-13-9~4697^2~28^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2ce3f5dcdf2787e2bd777ddc3eaefd370dc6c050;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind() My static checker complains that it's possible for "r" to be uninitialized. It used to be set to zero so this returns it to the old behavior. Fixes: 98a7f88ce9a9 ("drm/amdgpu: bind BOs with GTT space allocated directly v2") Reviewed-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 1a3ea93382aa..c803b082324d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -753,7 +753,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) { struct amdgpu_ttm_tt *gtt = (void*)ttm; - int r; + int r = 0; if (gtt->userptr) { r = amdgpu_ttm_tt_pin_userptr(ttm);