From: Li Zefan <[email protected]> Don't forget to release cgroup_mutex if alloc_trial_cpuset() fails.
[[email protected]: avoid multiple return points] Signed-off-by: Li Zefan <[email protected]> Cc: Paul Menage <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Miao Xie <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> --- kernel/cpuset.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff -puN kernel/cpuset.c~cpuset-add-a-missing-unlock-in-cpuset_write_resmask kernel/cpuset.c --- a/kernel/cpuset.c~cpuset-add-a-missing-unlock-in-cpuset_write_resmask +++ a/kernel/cpuset.c @@ -1575,8 +1575,10 @@ static int cpuset_write_resmask(struct c return -ENODEV; trialcs = alloc_trial_cpuset(cs); - if (!trialcs) - return -ENOMEM; + if (!trialcs) { + retval = -ENOMEM; + goto out; + } switch (cft->private) { case FILE_CPULIST: @@ -1591,6 +1593,7 @@ static int cpuset_write_resmask(struct c } free_trial_cpuset(trialcs); +out: cgroup_unlock(); return retval; } _ _______________________________________________ stable mailing list [email protected] http://linux.kernel.org/mailman/listinfo/stable
