mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-14 17:40:41 +09:00
cpuset: add a missing unlock in cpuset_write_resmask()
commit b75f38d659 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0533a1fed2
commit
cf666a4bfe
@@ -1514,8 +1514,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:
|
||||
@@ -1530,6 +1532,7 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
|
||||
}
|
||||
|
||||
free_trial_cpuset(trialcs);
|
||||
out:
|
||||
cgroup_unlock();
|
||||
return retval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user