drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 9 Aug 2017 10:30:46 +0000 (13:30 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Aug 2017 18:46:19 +0000 (14:46 -0400)
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 <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index 1a3ea93382aac93837f946d6bdea2c9303c25f9f..c803b082324dcb35c1364cd4e33eab842c6f1668 100644 (file)
@@ -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);