Skip to content

Commit

Permalink
cgroup: fix missing unlock in cgroup_release_agent()
Browse files Browse the repository at this point in the history
The patch 971ff49: "cgroup: use a per-cgroup work for release
agent" from Sep 18, 2014, leads to the following static checker
warning:

	kernel/cgroup.c:5310 cgroup_release_agent()
	warn: 'mutex:&cgroup_mutex' is sometimes locked here and sometimes unlocked.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Zefan Li authored and Tejun Heo committed Sep 20, 2014
1 parent a25eb52 commit 3e2cd91
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -5291,7 +5291,10 @@ static void cgroup_release_agent(struct work_struct *work)

mutex_unlock(&cgroup_mutex);
call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
goto out_free;
out:
mutex_unlock(&cgroup_mutex);
out_free:
kfree(agentbuf);
kfree(pathbuf);
}
Expand Down

0 comments on commit 3e2cd91

Please sign in to comment.