hulk inclusion category: bugfix bugzilla: 182255 CVE: NA
-------------------------------------------------
cgroup_threadgroup_change_begin() is called after allocating futex_exit_mutex, cgroup_threadgroup_change_end() don't need be called on error path of allocating futex_exit_mutex.
Fixes: 04d0e96b230ac ("futex: sched: fix kabi broken in task_struct") Signed-off-by: Yang Yingliang yangyingliang@huawei.com Reviewed-by: Cheng Jian cj.chengjian@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/fork.c b/kernel/fork.c index adc8fc99246fb..e17aaa526c593 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -2176,10 +2176,10 @@ static __latent_entropy struct task_struct *copy_process( write_unlock_irq(&tasklist_lock); cgroup_cancel_fork(p); bad_fork_free_futex_mutex: + cgroup_threadgroup_change_end(current); kfree(p->futex_exit_mutex); p->futex_exit_mutex = NULL; bad_fork_free_pid: - cgroup_threadgroup_change_end(current); if (pid != &init_struct_pid) free_pid(pid); bad_fork_cleanup_thread: