diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2011-03-04 17:36:21 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-21 12:45:28 -0700 |
commit | 2c103bfa4db025da9ab9428981e9e8afcc765492 (patch) | |
tree | 848e5d9ddaa9e6e2b6b3bc7553a5b5717eacec78 /kernel | |
parent | 76d102e4c2e0509c58dfe51322e825604afdb0d0 (diff) | |
download | lwn-2c103bfa4db025da9ab9428981e9e8afcc765492.tar.gz lwn-2c103bfa4db025da9ab9428981e9e8afcc765492.zip |
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpuset.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 5d38bd74483c..6145d226b33c 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1513,8 +1513,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: @@ -1529,6 +1531,7 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft, } free_trial_cpuset(trialcs); +out: cgroup_unlock(); return retval; } |