All the mail mirrored from 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@oracle.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
---
 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

* [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

* Re: [PATCH] cgroup: fix missing unlock in cgroup_release_agent()
@ 2014-09-20 16:24   ` Tejun Heo
  0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2014-09-20 16:24 UTC (permalink / raw
  To: Zefan Li; +Cc: Cgroups, LKML, Dan Carpenter

On Sat, Sep 20, 2014 at 02:35:43PM +0800, Zefan Li wrote:
> 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@oracle.com>
> Signed-off-by: Zefan Li <lizefan@huawei.com>

Applied to cgroup/for-3.18.

Thanks.

-- 
tejun

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

* Re: [PATCH] cgroup: fix missing unlock in cgroup_release_agent()
@ 2014-09-20 16:24   ` Tejun Heo
  0 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2014-09-20 16:24 UTC (permalink / raw
  To: Zefan Li; +Cc: Cgroups, LKML, Dan Carpenter

On Sat, Sep 20, 2014 at 02:35:43PM +0800, Zefan Li wrote:
> 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>

Applied to cgroup/for-3.18.

Thanks.

-- 
tejun

^ permalink raw reply	[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
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.