From: Zefan Li Date: Sat, 20 Sep 2014 06:35:43 +0000 (+0800) Subject: cgroup: fix missing unlock in cgroup_release_agent() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3e2cd91ab92665148616a80dc0745c499d2746a7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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. Reported-by: Dan Carpenter Signed-off-by: Zefan Li Signed-off-by: Tejun Heo --- diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 16e3a4f5c9dc..f873c4681316 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -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); }