alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mengdong Lin <mengdong.lin@linux.intel.com>
To: "Lin, Mengdong" <mengdong.lin@intel.com>,
	Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@perex.cz>
Cc: "Shah, Hardik T" <hardik.t.shah@intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"Singh, Guneshwor O" <guneshwor.o.singh@intel.com>,
	"Girdwood, Liam R" <liam.r.girdwood@intel.com>
Subject: Re: [PATCH 3/6] topology: Use generic pointer to realloc buffer for private data
Date: Wed, 4 May 2016 09:29:33 +0800	[thread overview]
Message-ID: <5729507D.2010400@linux.intel.com> (raw)
In-Reply-To: <F46914AEC2663F4A9BB62374E5EEF8F84BA01739@shsmsx102.ccr.corp.intel.com>



On 04/28/2016 10:30 PM, Lin, Mengdong wrote:
>> -----Original Message-----
>> From: Takashi Iwai [mailto:tiwai@suse.de]
>> Sent: Thursday, April 28, 2016 9:55 PM
>> To: Jaroslav Kysela
>> Cc: mengdong.lin@linux.intel.com; alsa-devel@alsa-project.org;
>> broonie@kernel.org; Girdwood, Liam R; Lin, Mengdong; Shah, Hardik T; Singh,
>> Guneshwor O
>> Subject: Re: [PATCH 3/6] topology: Use generic pointer to realloc buffer for
>> private data
>>
>> On Thu, 28 Apr 2016 10:48:36 +0200,
>> Jaroslav Kysela wrote:
>>>
>>> Dne 28.4.2016 v 10:41 mengdong.lin@linux.intel.com napsal(a):
>>>>   	priv_data_size = ref->data->size;
>>>> +	elem->obj = realloc(elem->obj,
>>>> +			elem->size + priv_data_size);
>>>> +	if (!elem->obj)
>>>> +		return -ENOMEM;
>>>
>>> This causes a memory leak when realloc fails. You should free the
>>> original pointer when realloc() fails.
>>
>> Right, and the bug (the leak) has been already present before the patch...
>>
>
> Okay, we'll fix this. Thanks for pointing out this.
>

I fixed this issue in v2 series. Would you please have a review?


Thanks again
Mengdong

  reply	other threads:[~2016-05-04  1:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28  8:40 [PATCH 0/6] topology: complete PCM parsing and code refactoring mengdong.lin
2016-04-28  8:41 ` [PATCH 1/6] topology: Set manifest size for ABI mengdong.lin
2016-04-28  8:41 ` [PATCH 2/6] topology: Refactor functions to parse and build streams mengdong.lin
2016-04-28  8:41 ` [PATCH 3/6] topology: Use generic pointer to realloc buffer for private data mengdong.lin
2016-04-28  8:48   ` Jaroslav Kysela
2016-04-28 13:55     ` Takashi Iwai
2016-04-28 14:30       ` Lin, Mengdong
2016-05-04  1:29         ` Mengdong Lin [this message]
2016-05-08  9:52           ` Takashi Iwai
2016-04-28  8:41 ` [PATCH 4/6] topology: Fix pcm ID & name parsing mengdong.lin
2016-04-28  8:42 ` [PATCH 5/6] topology: Parse front-end DAI name and ID for the PCM mengdong.lin
2016-04-28  8:42 ` [PATCH 6/6] topology: Update PCM configurations in Broadwell text conf file mengdong.lin

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=5729507D.2010400@linux.intel.com \
    --to=mengdong.lin@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=guneshwor.o.singh@intel.com \
    --cc=hardik.t.shah@intel.com \
    --cc=liam.r.girdwood@intel.com \
    --cc=mengdong.lin@intel.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).