Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b75f38d6 authored by Li Zefan's avatar Li Zefan Committed by Linus Torvalds
Browse files

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: default avatarLi Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Cc: Miao Xie <miaox@cn.fujitsu.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2ec38a03
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1575,8 +1575,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:
@@ -1591,6 +1593,7 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
	}

	free_trial_cpuset(trialcs);
out:
	cgroup_unlock();
	return retval;
}