[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <22003e76-0aae-e699-f231-85f8313e4a36@huawei.com>
Date: Thu, 24 Nov 2022 00:03:48 +0800
From: xiujianfeng <xiujianfeng@...wei.com>
To: Juergen Gross <jgross@...e.com>, <boris.ostrovsky@...cle.com>,
<tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>, <hpa@...or.com>, <jeremy@...p.org>
CC: <x86@...nel.org>, <xen-devel@...ts.xenproject.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 0/2] x86/xen: Fix memory leak issue
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
Powered by blists - more mailing lists