[PATCH] cpuset: Add a missing unlock in cpuset_write_resmask()

From: Li Zefan
Date: Thu Feb 24 2011 - 01:57:23 EST


Don't forget to release cgroup_mutex if alloc_trial_cpuset() fails.

Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>
---
kernel/cpuset.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 1ca786a..6272503 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1561,8 +1561,10 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
return -ENODEV;

trialcs = alloc_trial_cpuset(cs);
- if (!trialcs)
+ if (!trialcs) {
+ cgroup_unlock();
return -ENOMEM;
+ }

switch (cft->private) {
case FILE_CPULIST:
--
1.7.3.1
--
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/