mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nirmoy <nirmodas@amd.com>
To: "Koenig, Christian" <Christian.Koenig@amd.com>,
	Nirmoy Das <nirmoy.aiemd@gmail.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: "airlied@linux.ie" <airlied@linux.ie>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Das, Nirmoy" <Nirmoy.Das@amd.com>
Subject: Re: [PATCH] drm/amdgpu: fix memory leak
Date: Fri, 4 Oct 2019 11:00:15 +0000	[thread overview]
Message-ID: <32afa408-0968-2d1a-5add-593907636592@amd.com> (raw)
In-Reply-To: <62ea397d-2847-04d7-3c50-6292255845c5@amd.com>


On 10/4/19 12:44 PM, Koenig, Christian wrote:
> First of all please send mails regarding amdgpu to the amd-gfx mailing
> list and not lkml/dri-devel.
Okay.
> Am 04.10.19 um 12:17 schrieb Nirmoy Das:
>> In amdgpu_bo_list_ioctl when idr_alloc fails
>> don't return without freeing bo list entry.
>>
>> Fixes: 964d0fbf6301d ("drm/amdgpu: Allow to create BO lists in CS ioctl v3")
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>>    drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
>> index 7bcf86c61999..c3e5ea544857 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
>> @@ -284,7 +284,7 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
>>    		mutex_unlock(&fpriv->bo_list_lock);
>>    		if (r < 0) {
>>    			amdgpu_bo_list_put(list);
>> -			return r;
>> +			goto error_free;
> NAK, that is a double free. The bo list entries are freed by
> amdgpu_bo_list_put().
Thanks, didn't realize that.
> Regards,
> Christian.

Regards,

Nirmoy

>>    		}
>>    
>>    		handle = r;

  reply	other threads:[~2019-10-04 11:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 10:17 Nirmoy Das
2019-10-04 10:44 ` Koenig, Christian
2019-10-04 11:00   ` Nirmoy [this message]
2019-10-04 11:13     ` Koenig, Christian
2019-10-04 11:26       ` Nirmoy
2019-10-04 11:30         ` Koenig, Christian
2019-10-04 11:36           ` Nirmoy
  -- strict thread matches above, loose matches on Subject: below --
2015-09-18  8:46 Sudip Mukherjee

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=32afa408-0968-2d1a-5add-593907636592@amd.com \
    --to=nirmodas@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Nirmoy.Das@amd.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nirmoy.aiemd@gmail.com \
    /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

all inboxes | Powered by JetHome®