mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: "Das, Nirmoy" <Nirmoy.Das@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>
Subject: Re: [PATCH] drm/amdgpu: fix memory leak
Date: Fri, 4 Oct 2019 11:30:38 +0000	[thread overview]
Message-ID: <fef8697b-30c4-e4e1-f45c-d3377dbd444e@amd.com> (raw)
In-Reply-To: <e79aa8f8-5198-bfd9-3f69-e7975bac3232@amd.com>

Am 04.10.19 um 13:26 schrieb Das, Nirmoy:
> On 10/4/19 1:13 PM, Koenig, Christian wrote:
>>>> NAK, that is a double free. The bo list entries are freed by
>>>> amdgpu_bo_list_put().
>>> Thanks, didn't realize that.
>> Wait a second, what entries are you talking about?
>>
>> The entries in the list object are freed when amdgpu_bo_list_put() is
>> called, but the temporary info array with the handles needs to be freed
>> as well.
>>
>> And it looks like that is indeed leaked here.
> I am talking about the `info` array created by
> amdgpu_bo_create_list_entry_array().

Yeah, that are the handles and not the entries. Sorry that I was 
confused about that.

Your patch is correct, you should just update the commit message a bit.

BTW: Could you cleanup error handling here a bit more?

E.g. add an error_put_list handle and drop the "if (info)" and instead 
return directly if we fail to allocate info.

Thanks,
Christian.

>> Regards,
>> Christian.
>>
>>>> Regards,
>>>> Christian.
>>> Regards,
>>>
>>> Nirmoy
>>>
>>>>>       		}
>>>>>       
>>>>>       		handle = r;


  reply	other threads:[~2019-10-04 11:30 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
2019-10-04 11:13     ` Koenig, Christian
2019-10-04 11:26       ` Nirmoy
2019-10-04 11:30         ` Koenig, Christian [this message]
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=fef8697b-30c4-e4e1-f45c-d3377dbd444e@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@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®