From: xiujianfeng <xiujianfeng@huawei.com>
To: Juergen Gross <jgross@suse.com>, <boris.ostrovsky@oracle.com>,
<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <hpa@zytor.com>, <jeremy@goop.org>
Cc: <x86@kernel.org>, <xen-devel@lists.xenproject.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/2] x86/xen: Fix memory leak issue
Date: Thu, 24 Nov 2022 00:03:48 +0800 [thread overview]
Message-ID: <22003e76-0aae-e699-f231-85f8313e4a36@huawei.com> (raw)
In-Reply-To: <33b9d446-9907-ded6-114e-ce6c43cc3446@suse.com>
Hi,
在 2022/11/23 23:23, Juergen Gross 写道:
> On 19.11.22 09:59, Xiu Jianfeng wrote:
>> The new string allocated by kasprintf() is leaked on error path
>>
>> Xiu Jianfeng (2):
>> x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
>> x86/xen: Fix memory leak in xen_init_lock_cpu()
>>
>> arch/x86/xen/smp.c | 16 ++++++++++++----
>> arch/x86/xen/smp_pv.c | 8 ++++++--
>> arch/x86/xen/spinlock.c | 3 ++-
>> 3 files changed, 20 insertions(+), 7 deletions(-)
>>
>
> Hmm, I think it would make more sense to always store the name generated
> via kasprintf() in the percpu variable (independently from succeeding to
> bind the irq), and in the related free function to always kfree() it and
> set it to NULL again.
>
> This would result in less code.
Thanks, It's good to me, already sent v2.
>
>
> Juergen
prev parent reply other threads:[~2022-11-23 16:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-19 8:59 Xiu Jianfeng
2022-11-19 8:59 ` [PATCH 1/2] x86/xen: Fix memory leak in xen_smp_intr_init{_pv}() Xiu Jianfeng
2022-11-19 8:59 ` [PATCH 2/2] x86/xen: Fix memory leak in xen_init_lock_cpu() Xiu Jianfeng
2022-11-23 15:23 ` [PATCH 0/2] x86/xen: Fix memory leak issue Juergen Gross
2022-11-23 16:03 ` xiujianfeng [this message]
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=22003e76-0aae-e699-f231-85f8313e4a36@huawei.com \
--to=xiujianfeng@huawei.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®