summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2011-03-04 17:36:21 -0800
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-06-26 12:46:56 -0400
commite9dab809ef06d2be702cfe04a1d22436b5ef6f1f (patch)
tree71e19077a60c017db9199dfd5613b2df38894fe9 /kernel
parent0c55f20bb8b94ef1898259568ec8e869b8a6cffb (diff)
cpuset: add a missing unlock in cpuset_write_resmask()
commit b75f38d659e6fc747eda64cb72f3920e29dd44a4 upstream. Don't forget to release cgroup_mutex if alloc_trial_cpuset() fails. [akpm@linux-foundation.org: avoid multiple return points] Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Paul Menage <menage@google.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 9a50c5f6e727..8f024fa0bbe3 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1534,8 +1534,10 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
return -ENODEV;
trialcs = alloc_trial_cpuset(cs);
- if (!trialcs)
- return -ENOMEM;
+ if (!trialcs) {
+ retval = -ENOMEM;
+ goto out;
+ }
switch (cft->private) {
case FILE_CPULIST:
@@ -1550,6 +1552,7 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
}
free_trial_cpuset(trialcs);
+out:
cgroup_unlock();
return retval;
}