AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: James Zhu <jamesz-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: don't try to unreserve NULL pointer
Date: Tue, 18 Sep 2018 09:14:40 +0200	[thread overview]
Message-ID: <fc6e1d22-40cc-e856-ead1-9f043841d60f@gmail.com> (raw)
In-Reply-To: <4304faa2-5777-9d0a-c8e8-b00e431238f0-5C7GfCeVMHo@public.gmane.org>

Am 17.09.2018 um 20:41 schrieb James Zhu:
>
>
> On 2018-09-17 02:07 PM, Christian König wrote:
>> Don't try to unreserve a BO we doesn't allocated.
>>
>> Fixes: 07012fdd497e drm/amdgpu: don't allocate zero sized kernel BOs
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 84d82d5382f9..c1387efc0c91 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -348,7 +348,8 @@ int amdgpu_bo_create_kernel(struct amdgpu_device 
>> *adev,
>>       if (r)
>>           return r;
>>   -    amdgpu_bo_unreserve(*bo_ptr);
>> +    if (*bo_ptr)
> Can we put this check inside ttm_bo_unreserve?

No, calling amdgpu_bo_unreserve() with a NULL pointer is certainly a bug.

Christian.

> James Zhu
>> +        amdgpu_bo_unreserve(*bo_ptr);
>>         return 0;
>>   }
>
> _______________________________________________
> 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

  parent reply	other threads:[~2018-09-18  7:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 18:07 [PATCH] drm/amdgpu: don't try to unreserve NULL pointer Christian König
     [not found] ` <20180917180724.1803-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-17 18:41   ` James Zhu
     [not found]     ` <4304faa2-5777-9d0a-c8e8-b00e431238f0-5C7GfCeVMHo@public.gmane.org>
2018-09-18  7:14       ` Christian König [this message]
2018-09-18  5:48   ` Huang Rui
2018-09-18  6:16   ` Zhu, Rex
     [not found]     ` <BYAPR12MB27754BE2A5210C53B1054F53FB1D0-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-18  7:14       ` Christian König
     [not found]         ` <27a7e247-d895-17e8-5493-051dea82536d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-18  8:16           ` Zhu, Rex
     [not found]             ` <BYAPR12MB27759724D41FECEEC1926845FB1D0-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-18  8:40               ` Christian König
     [not found]                 ` <248d2af0-e330-90e9-38c8-176a2bbd3649-5C7GfCeVMHo@public.gmane.org>
2018-09-18  9:27                   ` Zhu, Rex
     [not found]                     ` <BYAPR12MB27755971A03F2E03A5BF58BCFB1D0-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-09-18  9:33                       ` Christian König
     [not found]                         ` <279b1ebf-326e-34b9-2878-bda3ffee21b8-5C7GfCeVMHo@public.gmane.org>
2018-09-18  9:55                           ` Zhu, Rex

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc6e1d22-40cc-e856-ead1-9f043841d60f@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=jamesz-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox