lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <51DB5D5F.4050501@asianux.com>
Date:	Tue, 09 Jul 2013 08:46:23 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	Wang YanQing <udknight@...il.com>,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	lig.fnst@...fujitsu.com, chuansheng.liu@...el.com,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] kernel/smp.c: free related resources when failure
 occurs in hotplug_cfd()

On 07/09/2013 08:46 AM, Wang YanQing wrote:
> On Tue, Jul 09, 2013 at 08:43:05AM +0800, Chen Gang wrote:
>> > When failure occurs in hotplug_cfd(), need release related resources,
>> > or will cause memory leak.
>> > 
>> > Signed-off-by: Chen Gang <gang.chen@...anux.com>
>> > ---
>> >  kernel/smp.c |    5 ++++-
>> >  1 files changed, 4 insertions(+), 1 deletions(-)
>> > 
>> > diff --git a/kernel/smp.c b/kernel/smp.c
>> > index 02a885d..2a3a017 100644
>> > --- a/kernel/smp.c
>> > +++ b/kernel/smp.c
>> > @@ -49,10 +49,13 @@ hotplug_cfd(struct notifier_block *nfb, unsigned long action, void *hcpu)
>> >  				cpu_to_node(cpu)))
>> >  			return notifier_from_errno(-ENOMEM);
>> >  		if (!zalloc_cpumask_var_node(&cfd->cpumask_ipi, GFP_KERNEL,
>> > -				cpu_to_node(cpu)))
>> > +				cpu_to_node(cpu))) {
>> > +			free_cpumask_var(cfd->cpumask);
>> >  			return notifier_from_errno(-ENOMEM);
>> > +		}
>> >  		cfd->csd = alloc_percpu(struct call_single_data);
>> >  		if (!cfd->csd) {
>> > +			free_cpumask_var(cfd->cpumask_ipi);
>> >  			free_cpumask_var(cfd->cpumask);
>> >  			return notifier_from_errno(-ENOMEM);
>> >  		}
>> > -- 
>> > 1.7.7.6
> Acked-by: Wang YanQing <udknight@...il.com>
> 
> 

Thanks  :-)

-- 
Chen Gang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ