diff mbox series

drm/amdgpu: fix amdgpu_preempt_mgr_new()

Message ID YMxbQXg/Wqm0ACxt@mwanda (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: fix amdgpu_preempt_mgr_new() | expand

Commit Message

Dan Carpenter June 18, 2021, 8:37 a.m. UTC
There is a reversed if statement in amdgpu_preempt_mgr_new() so it
always returns -ENOMEM.

Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian König June 18, 2021, 8:39 a.m. UTC | #1
Am 18.06.21 um 10:37 schrieb Dan Carpenter:
> There is a reversed if statement in amdgpu_preempt_mgr_new() so it
> always returns -ENOMEM.
>
> Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Most be some fallout from merging it with the TTM changes.

Anyway, patch is Reviewed-by: Christian König <christian.koenig@amd.com>

Thanks,
Christian.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> index f6aff7ce5160..d02c8637f909 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> @@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man,
>   	struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
>   
>   	*res = kzalloc(sizeof(**res), GFP_KERNEL);
> -	if (*res)
> +	if (!*res)
>   		return -ENOMEM;
>   
>   	ttm_resource_init(tbo, place, *res);
Felix Kuehling June 18, 2021, 3:40 p.m. UTC | #2
Am 2021-06-18 um 4:39 a.m. schrieb Christian König:
> Am 18.06.21 um 10:37 schrieb Dan Carpenter:
>> There is a reversed if statement in amdgpu_preempt_mgr_new() so it
>> always returns -ENOMEM.
>>
>> Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of
>> git://anongit.freedesktop.org/drm/drm-misc into drm-next")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Most be some fallout from merging it with the TTM changes.
>
> Anyway, patch is Reviewed-by: Christian König <christian.koenig@amd.com>

This is obviously not for amd-staging-drm-next. Christian, are you going
to apply it to the relevant branches?

Thanks,
  Felix


>
> Thanks,
> Christian.
>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>> index f6aff7ce5160..d02c8637f909 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>> @@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
>> ttm_resource_manager *man,
>>       struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
>>         *res = kzalloc(sizeof(**res), GFP_KERNEL);
>> -    if (*res)
>> +    if (!*res)
>>           return -ENOMEM;
>>         ttm_resource_init(tbo, place, *res);
>
Alex Deucher June 18, 2021, 9:18 p.m. UTC | #3
On Fri, Jun 18, 2021 at 11:40 AM Felix Kuehling <felix.kuehling@amd.com> wrote:
>
> Am 2021-06-18 um 4:39 a.m. schrieb Christian König:
> > Am 18.06.21 um 10:37 schrieb Dan Carpenter:
> >> There is a reversed if statement in amdgpu_preempt_mgr_new() so it
> >> always returns -ENOMEM.
> >>
> >> Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of
> >> git://anongit.freedesktop.org/drm/drm-misc into drm-next")
> >> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > Most be some fallout from merging it with the TTM changes.
> >
> > Anyway, patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>
> This is obviously not for amd-staging-drm-next. Christian, are you going
> to apply it to the relevant branches?

I've applied it to my drm-next branch.

Alex


>
> Thanks,
>   Felix
>
>
> >
> > Thanks,
> > Christian.
> >
> >> ---
> >>   drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> >> index f6aff7ce5160..d02c8637f909 100644
> >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
> >> @@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
> >> ttm_resource_manager *man,
> >>       struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
> >>         *res = kzalloc(sizeof(**res), GFP_KERNEL);
> >> -    if (*res)
> >> +    if (!*res)
> >>           return -ENOMEM;
> >>         ttm_resource_init(tbo, place, *res);
> >
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König June 21, 2021, 10:27 a.m. UTC | #4
Am 18.06.21 um 23:18 schrieb Alex Deucher:
> On Fri, Jun 18, 2021 at 11:40 AM Felix Kuehling <felix.kuehling@amd.com> wrote:
>> Am 2021-06-18 um 4:39 a.m. schrieb Christian König:
>>> Am 18.06.21 um 10:37 schrieb Dan Carpenter:
>>>> There is a reversed if statement in amdgpu_preempt_mgr_new() so it
>>>> always returns -ENOMEM.
>>>>
>>>> Fixes: 09b020bb05a5 ("Merge tag 'drm-misc-next-2021-06-09' of
>>>> git://anongit.freedesktop.org/drm/drm-misc into drm-next")
>>>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>> Most be some fallout from merging it with the TTM changes.
>>>
>>> Anyway, patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>> This is obviously not for amd-staging-drm-next. Christian, are you going
>> to apply it to the relevant branches?
> I've applied it to my drm-next branch.

I already pushed it to drm-misc-next last week.

Christian.

>
> Alex
>
>
>> Thanks,
>>    Felix
>>
>>
>>> Thanks,
>>> Christian.
>>>
>>>> ---
>>>>    drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>>>> index f6aff7ce5160..d02c8637f909 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
>>>> @@ -71,7 +71,7 @@ static int amdgpu_preempt_mgr_new(struct
>>>> ttm_resource_manager *man,
>>>>        struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
>>>>          *res = kzalloc(sizeof(**res), GFP_KERNEL);
>>>> -    if (*res)
>>>> +    if (!*res)
>>>>            return -ENOMEM;
>>>>          ttm_resource_init(tbo, place, *res);
>> _______________________________________________
>> 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
Alex Deucher June 21, 2021, 3:40 p.m. UTC | #5
[Public]

I've dropped it from my tree in that case.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
index f6aff7ce5160..d02c8637f909 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_preempt_mgr.c
@@ -71,7 +71,7 @@  static int amdgpu_preempt_mgr_new(struct ttm_resource_manager *man,
 	struct amdgpu_preempt_mgr *mgr = to_preempt_mgr(man);
 
 	*res = kzalloc(sizeof(**res), GFP_KERNEL);
-	if (*res)
+	if (!*res)
 		return -ENOMEM;
 
 	ttm_resource_init(tbo, place, *res);