* [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
@ 2017-08-09 10:30 Dan Carpenter
2017-08-10 2:16 ` Michel Dänzer
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-08-09 10:30 UTC (permalink / raw)
To: Alex Deucher, Christian König
Cc: David Airlie, Michel Dänzer, Felix Kuehling, Chunming Zhou,
Flora Cui, amd-gfx, dri-devel, kernel-janitors
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 <dan.carpenter@oracle.com>
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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
2017-08-09 10:30 [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind() Dan Carpenter
@ 2017-08-10 2:16 ` Michel Dänzer
[not found] ` <406505cd-fd17-b87a-0d3f-9adf5376880a-otUistvHUpPR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2017-08-10 2:16 UTC (permalink / raw)
To: Dan Carpenter, Alex Deucher, Christian König
Cc: Felix Kuehling, kernel-janitors, dri-devel, amd-gfx, Flora Cui
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 <dan.carpenter@oracle.com>
>
> 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 <michel.daenzer@amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
[not found] ` <406505cd-fd17-b87a-0d3f-9adf5376880a-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-08-10 5:34 ` Alex Deucher
2017-08-10 9:19 ` Christian König
0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2017-08-10 5:34 UTC (permalink / raw)
To: Michel Dänzer
Cc: Chunming Zhou, David Airlie, Felix Kuehling,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
Maling list - DRI developers, amd-gfx list, Alex Deucher,
Flora Cui, Christian König, Dan Carpenter
On Wed, Aug 9, 2017 at 10:16 PM, Michel Dänzer <michel@daenzer.net> 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 <dan.carpenter@oracle.com>
>>
>> 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 <michel.daenzer@amd.com>
Applied. thanks!
Alex
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind()
2017-08-10 5:34 ` Alex Deucher
@ 2017-08-10 9:19 ` Christian König
0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2017-08-10 9:19 UTC (permalink / raw)
To: Alex Deucher, Michel Dänzer
Cc: Felix Kuehling, kernel-janitors, amd-gfx list,
Maling list - DRI developers, Alex Deucher, Flora Cui,
Christian König, Dan Carpenter
Am 10.08.2017 um 07:34 schrieb Alex Deucher:
> On Wed, Aug 9, 2017 at 10:16 PM, Michel Dänzer <michel@daenzer.net> 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 <dan.carpenter@oracle.com>
>>>
>>> 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 <michel.daenzer@amd.com>
> Applied. thanks!
For what's worth Reviewed-by: Christian König <christian.koenig@amd.com>
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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-10 9:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 10:30 [PATCH] drm/amdgpu: Uninitialized variable in amdgpu_ttm_backend_bind() Dan Carpenter
2017-08-10 2:16 ` Michel Dänzer
[not found] ` <406505cd-fd17-b87a-0d3f-9adf5376880a-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-08-10 5:34 ` Alex Deucher
2017-08-10 9:19 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).