From: Timur Tabi <timur@freescale.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Kumar Gala <galak@kernel.crashing.org>
Cc: kernel-janitors@vger.kernel.org, Julia Lawall <julia@diku.dk>,
linuxppc-dev@lists.ozlabs.org, Paul Mackerras <paulus@samba.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/9] arch/powerpc/sysdev/ehv_pic.c: add missing kfree
Date: Tue, 23 Aug 2011 14:04:46 -0500 [thread overview]
Message-ID: <4E53F9CE.1040106@freescale.com> (raw)
In-Reply-To: <CAOZdJXX_BS7GMtmyqiS91QByhrjANtKpbqrstR8g-L80r_N8qg@mail.gmail.com>
Ben, Kumar, can one of you take a look at my question and help me out?
wrote:
> On Mon, Aug 8, 2011 at 7:18 AM, Julia Lawall <julia@diku.dk> wrote:
>
>> diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c
>> index af1a5df..b6731e4 100644
>> --- a/arch/powerpc/sysdev/ehv_pic.c
>> +++ b/arch/powerpc/sysdev/ehv_pic.c
>> @@ -280,6 +280,7 @@ void __init ehv_pic_init(void)
>>
>> if (!ehv_pic->irqhost) {
>> of_node_put(np);
>> + kfree(ehv_pic);
>> return;
>> }
>
> Although the fix is correct, I think there is another bug in this
> function. 'np' is not released when the function finishes
> successfully. I've looked at other functions that use
> irq_alloc_host(), and most of them do the same thing: they don't call
> of_node_put() on the device node pointer. The only exception I've
> found is mpc5121_ads_cpld_pic_init().
>
> Ben, Kumar: am I missing something? irq_alloc_host() calls of_node_get():
>
> host->of_node = of_node_get(of_node);
>
> so doesn't that mean that the caller of irq_alloc_host() should
> release the device node pointer?
>
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2011-08-23 19:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-08 11:18 [PATCH 8/9] arch/powerpc/sysdev/ehv_pic.c: add missing kfree Julia Lawall
2011-08-15 22:55 ` Tabi Timur-B04825
2011-08-23 19:04 ` Timur Tabi [this message]
2011-08-23 18:38 ` Timur Tabi
2011-11-24 7:16 ` Kumar Gala
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=4E53F9CE.1040106@freescale.com \
--to=timur@freescale.com \
--cc=benh@kernel.crashing.org \
--cc=galak@kernel.crashing.org \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).