cpuset: add a missing unlock in cpuset_write_resmask()
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> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2ec38a0359
commit
b75f38d659
|
@ -1575,8 +1575,10 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
trialcs = alloc_trial_cpuset(cs);
|
trialcs = alloc_trial_cpuset(cs);
|
||||||
if (!trialcs)
|
if (!trialcs) {
|
||||||
return -ENOMEM;
|
retval = -ENOMEM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
switch (cft->private) {
|
switch (cft->private) {
|
||||||
case FILE_CPULIST:
|
case FILE_CPULIST:
|
||||||
|
@ -1591,6 +1593,7 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
|
||||||
}
|
}
|
||||||
|
|
||||||
free_trial_cpuset(trialcs);
|
free_trial_cpuset(trialcs);
|
||||||
|
out:
|
||||||
cgroup_unlock();
|
cgroup_unlock();
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue