lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 0/2] x86/xen: Fix memory leak issue
From
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.


Juergen
[unhandled content-type:application/pgp-keys][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-11-23 16:24    [W:0.039 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site