All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: fix missing unlock in cgroup_release_agent()
@ 2014-09-20  6:35 ` Zefan Li
  0 siblings, 0 replies; 4+ messages in thread
From: Zefan Li @ 2014-09-20  6:35 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Cgroups, LKML, Dan Carpenter

The patch 971ff4935538: "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-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Zefan Li <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 kernel/cgroup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 7f23551..33f15b3 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5290,7 +5290,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);
 }
-- 
1.8.0.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-20 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-20  6:35 [PATCH] cgroup: fix missing unlock in cgroup_release_agent() Zefan Li
2014-09-20  6:35 ` Zefan Li
     [not found] ` <541D203F.4020902-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-09-20 16:24   ` Tejun Heo
2014-09-20 16:24     ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.