Skip to contentSkip to conversation

cgroup: fix missing unlock in cgroup_release_agent()

PATCH Applied Zefan Li 2 participants 2 messages Sep 20, 2014 cgroup

lore
Share & tools
lore

Zefan Li

author
#0 lore raw

PATCH 1/1 cgroup: fix missing unlock in cgroup_release_agent()

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.
---
 kernel/cgroup.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/cgroup.c +3 -0
index 7f23551..33f15b3 100644
@@ -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);
 }
Signature · 1 line
1.8.0.2
maintainer Applied
#1 lore raw
Quoted 9 lines · Zefan Li

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.

Applied to cgroup/for-3.18.

Thanks.

Signature · 1 line
tejun