All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Tyrel Datwyler <tyreld@linux.ibm.com>,
	Yuanjun Gong <ruc_gongyuanjun@163.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] powerpc: fix a memory leak
Date: Fri, 15 Sep 2023 10:50:28 +1000	[thread overview]
Message-ID: <87il8c6yzv.fsf@mail.lhotse> (raw)
In-Reply-To: <54bf92e8-f884-1567-2149-caf638ff8f68@linux.ibm.com>

Tyrel Datwyler <tyreld@linux.ibm.com> writes:
> On 9/14/23 02:46, Yuanjun Gong wrote:
>> When one of the methods xive_native_alloc_irq_on_chip, irq_create_mapping
>> or irq_get_handler_data fails, the function will directly return without
>> disposing vinst->name and vinst. Fix it.
>> 
>> Fixes: c20e1e299d93 ("powerpc/vas: Alloc and setup IRQ and trigger port address")
>> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
>> ---
>>  arch/powerpc/platforms/powernv/vas.c | 14 +++++++++-----
>>  1 file changed, 9 insertions(+), 5 deletions(-)
>> 
>> diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c
>> index b65256a63e87..780740b478f0 100644
>> --- a/arch/powerpc/platforms/powernv/vas.c
>> +++ b/arch/powerpc/platforms/powernv/vas.c
>> @@ -54,7 +54,7 @@ static int init_vas_instance(struct platform_device *pdev)
>>  	struct xive_irq_data *xd;
>>  	uint32_t chipid, hwirq;
>>  	struct resource *res;
>> -	int rc, cpu, vasid;
>> +	int rc, cpu, vasid, ret;
>
> You can you reuse rc for the return value in the error path instead of
> introducing a new ret variable.

Yep, please send a v2.

cheers

  reply	other threads:[~2023-09-15  0:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14  9:46 [PATCH 1/1] powerpc: fix a memory leak Yuanjun Gong
2023-09-14 16:10 ` Tyrel Datwyler
2023-09-15  0:50   ` Michael Ellerman [this message]
2023-09-15  2:05   ` [PATCH v2 " Yuanjun Gong
2023-09-15  2:05     ` Yuanjun Gong
2023-09-24  1:18     ` kernel test robot
2023-09-24  1:18       ` kernel test robot
2023-11-08  9:24     ` kernel test robot
2023-11-08  9:24       ` kernel test robot

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=87il8c6yzv.fsf@mail.lhotse \
    --to=mpe@ellerman.id.au \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=ruc_gongyuanjun@163.com \
    --cc=tyreld@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.