From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: Phil Carmody <ext-phil.2.carmody@nokia.com>
Cc: "Menon, Nishanth" <nm@ti.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/2] dspbridge: proc: fix a double-free on 2 error paths
Date: Wed, 17 Feb 2010 09:52:25 -0600 [thread overview]
Message-ID: <4B7C10B9.3050103@ti.com> (raw)
In-Reply-To: <20100217131245.GE463@pcarmody-desktop>
On 2/17/2010 7:12 AM, Phil Carmody wrote:
> On 17/02/10 01:24 +0100, ext Omar Ramirez Luna wrote:
>> On 2/12/2010 10:26 AM, Phil Carmody wrote:
>>> From: Phil Carmody<ext-phil.2.carmody@nokia.com>
>>>
>>> We free in the tail cleanup, so don't free before jumping there.
>>>
>>> Signed-off-by: Phil Carmody<ext-phil.2.carmody@nokia.com>
>>> ---
>>
>> [...]
>>> }
>>> +
>>> + /* paranoid - must be able to kfree this on remaining error paths */
>>> + pProcObject->g_pszLastCoff = NULL;
>>> +
>>
>> do we need this? afaik it should be NULL at this point, because of
>> kmalloc + memset (which btw should be replaced by kzalloc).
>
> I suspected it wasn't. I confess I was a little bit rushed when
> looking at that.
>
>> i.e:
>> MEM_AllocObject(pProcObject, struct PROC_OBJECT, PROC_SIGNATURE);
>> -> MEM_Calloc(sizeof(Obj), MEM_NONPAGED);
>> -> pMem = kmalloc(...)
>> if (pMem)
>> memset(pMem, 0, cBytes);
>
> i.e. kzalloc().
>
>>> /* Get the default executable for this board... */
>>> DEV_GetDevType(hDevObject, (u32 *)&devType);
>>> pProcObject->uProcessor = devType;
>> [...]
>>
>> Regards,
>
> I can resend without, if you like, whatever's simplest for you.
>
No worries, I'll remove from original.
Regards,
Omar
next prev parent reply other threads:[~2010-02-17 15:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 16:26 [PATCH 0/2] dspbridge: proc: double free on error path Phil Carmody
2010-02-12 16:26 ` [PATCH 1/2] dspbridge: proc: it's a pointer, not a handle Phil Carmody
2010-02-12 16:26 ` [PATCH 2/2] dspbridge: proc: fix a double-free on 2 error paths Phil Carmody
2010-02-17 0:24 ` Omar Ramirez Luna
2010-02-17 13:12 ` Phil Carmody
2010-02-17 15:52 ` Omar Ramirez Luna [this message]
2010-02-18 23:53 ` Omar Ramirez Luna
2010-02-18 23:53 ` [PATCH 1/2] dspbridge: proc: it's a pointer, not a handle Omar Ramirez Luna
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=4B7C10B9.3050103@ti.com \
--to=omar.ramirez@ti.com \
--cc=ext-phil.2.carmody@nokia.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.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