[PATCH] [173/275] cpuset: add a missing unlock in cpuset_write_resmask()
From: Andi Kleen
Date: Wed Mar 30 2011 - 17:31:33 EST
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Li Zefan <lizf@xxxxxxxxxxxxxx>
commit b75f38d659e6fc747eda64cb72f3920e29dd44a4 upstream.
Don't forget to release cgroup_mutex if alloc_trial_cpuset() fails.
[akpm@xxxxxxxxxxxxxxxxxxxx: avoid multiple return points]
Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Paul Menage <menage@xxxxxxxxxx>
Acked-by: David Rientjes <rientjes@xxxxxxxxxx>
Cc: Miao Xie <miaox@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
kernel/cpuset.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: linux-2.6.35.y/kernel/cpuset.c
===================================================================
--- linux-2.6.35.y.orig/kernel/cpuset.c 2011-03-29 22:50:54.764857122 -0700
+++ linux-2.6.35.y/kernel/cpuset.c 2011-03-29 23:03:01.845252954 -0700
@@ -1576,8 +1576,10 @@
return -ENODEV;
trialcs = alloc_trial_cpuset(cs);
- if (!trialcs)
- return -ENOMEM;
+ if (!trialcs) {
+ retval = -ENOMEM;
+ goto out;
+ }
switch (cft->private) {
case FILE_CPULIST:
@@ -1592,6 +1594,7 @@
}
free_trial_cpuset(trialcs);
+out:
cgroup_unlock();
return retval;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/