Re: [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()

2017-08-10 Thread Christian König

Am 10.08.2017 um 07:34 schrieb Alex Deucher:

On Wed, Aug 9, 2017 at 10:16 PM, Michel Dänzer  wrote:

On 09/08/17 07:30 PM, Dan Carpenter wrote:

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")
Signed-off-by: Dan Carpenter 

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index e6f9a54c959d..b5f2a08757d6 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);

Reviewed-by: Michel Dänzer 

Applied.  thanks!


For what's worth Reviewed-by: Christian König  
as well.


Might as well explain some fallout people reported about this patch, 
going to ping them for testing.


Christian.



Alex
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()

2017-08-09 Thread Alex Deucher
On Wed, Aug 9, 2017 at 10:16 PM, Michel Dänzer  wrote:
> On 09/08/17 07:30 PM, Dan Carpenter wrote:
>> 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")
>> Signed-off-by: Dan Carpenter 
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index e6f9a54c959d..b5f2a08757d6 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);
>
> Reviewed-by: Michel Dänzer 

Applied.  thanks!

Alex
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()

2017-08-09 Thread Michel Dänzer
On 09/08/17 07:30 PM, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter 
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index e6f9a54c959d..b5f2a08757d6 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);

Reviewed-by: Michel Dänzer 


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx