Commit b75f38d659e6fc747eda64cb72f3920e29dd44a4
Committed by
Linus Torvalds
1 parent
2ec38a0359
Exists in
master
and in
39 other branches
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>
Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff
kernel/cpuset.c
... | ... | @@ -1575,8 +1575,10 @@ |
1575 | 1575 | return -ENODEV; |
1576 | 1576 | |
1577 | 1577 | trialcs = alloc_trial_cpuset(cs); |
1578 | - if (!trialcs) | |
1579 | - return -ENOMEM; | |
1578 | + if (!trialcs) { | |
1579 | + retval = -ENOMEM; | |
1580 | + goto out; | |
1581 | + } | |
1580 | 1582 | |
1581 | 1583 | switch (cft->private) { |
1582 | 1584 | case FILE_CPULIST: |
... | ... | @@ -1591,6 +1593,7 @@ |
1591 | 1593 | } |
1592 | 1594 | |
1593 | 1595 | free_trial_cpuset(trialcs); |
1596 | +out: | |
1594 | 1597 | cgroup_unlock(); |
1595 | 1598 | return retval; |
1596 | 1599 | } |