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>] [day] [month] [year] [list]
Message-ID: <4B9DC38C.30506@cn.fujitsu.com>
Date:	Mon, 15 Mar 2010 13:20:12 +0800
From:	Miao Xie <miaox@...fujitsu.com>
To:	Andrew Morton <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Paul Menage <menage@...gle.com>
CC:	Linux-Kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH V2 2/2] cpuset: alloc nodemask_t at heap not stack - fix

Changes from V1 to V2:
- remove unnecessary checking.

fix memory leak

Signed-off-by: Miao Xie <miaox@...fujitsu.com>
---
Against the following patch in mmotm-2010-03-11-13-13:
cpuset-alloc-nodemask_t-at-heap-not-stack.patch
---
 kernel/cpuset.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index f36e577..02b4545 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1401,7 +1401,7 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,
 	NODEMASK_ALLOC(nodemask_t, to, GFP_KERNEL);
 
 	if (from == NULL || to == NULL)
-		return;
+		goto alloc_fail;
 
 	if (cs == &top_cpuset) {
 		cpumask_copy(cpus_attach, cpu_possible_mask);
@@ -1432,6 +1432,7 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont,
 		mmput(mm);
 	}
 
+alloc_fail:
 	NODEMASK_FREE(from);
 	NODEMASK_FREE(to);
 }
-- 
1.6.5.2


--
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