cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] cgroup: fix missing unlock on error in cgroup_load_subsys()
@ 2013-12-09 12:38 Wei Yongjun
       [not found] ` <CAPgLHd8s94-e2=tynt-jKKNmoSXzNFHs+vYeUS1uW3+Ohk_OVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-12-09 12:38 UTC (permalink / raw)
  To: tj-DgEjT+Ai2ygdnm+yROfE0A, lizefan-hv44wF8Li93QT0dZR+AlfA
  Cc: yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	cgroups-u79uwXL29TY76Z2rM5mHXA

From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

Add the missing unlock before return from function cgroup_load_subsys()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
---
 kernel/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index fb1193b..402f7aa 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4618,6 +4618,7 @@ int __init_or_module cgroup_load_subsys(struct cgroup_subsys *ss)
 	if (IS_ERR(css)) {
 		/* failure case - need to deassign the cgroup_subsys[] slot. */
 		cgroup_subsys[ss->subsys_id] = NULL;
+		mutex_unlock(&cgroup_root_mutex);
 		mutex_unlock(&cgroup_mutex);
 		return PTR_ERR(css);
 	}

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

* Re: [PATCH -next] cgroup: fix missing unlock on error in cgroup_load_subsys()
       [not found] ` <CAPgLHd8s94-e2=tynt-jKKNmoSXzNFHs+vYeUS1uW3+Ohk_OVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-12-12  6:02   ` Li Zefan
  2013-12-12 15:46   ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Li Zefan @ 2013-12-12  6:02 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: tj-DgEjT+Ai2ygdnm+yROfE0A, cgroups-u79uwXL29TY76Z2rM5mHXA,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On 2013/12/9 20:38, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> 
> Add the missing unlock before return from function cgroup_load_subsys()
> in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

Acked-by: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>

but it conflicts with Vladimir's bug fix.

> ---
>  kernel/cgroup.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index fb1193b..402f7aa 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -4618,6 +4618,7 @@ int __init_or_module cgroup_load_subsys(struct cgroup_subsys *ss)
>  	if (IS_ERR(css)) {
>  		/* failure case - need to deassign the cgroup_subsys[] slot. */
>  		cgroup_subsys[ss->subsys_id] = NULL;
> +		mutex_unlock(&cgroup_root_mutex);
>  		mutex_unlock(&cgroup_mutex);
>  		return PTR_ERR(css);
>  	}
> 
> 

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

* Re: [PATCH -next] cgroup: fix missing unlock on error in cgroup_load_subsys()
       [not found] ` <CAPgLHd8s94-e2=tynt-jKKNmoSXzNFHs+vYeUS1uW3+Ohk_OVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2013-12-12  6:02   ` Li Zefan
@ 2013-12-12 15:46   ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2013-12-12 15:46 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: lizefan-hv44wF8Li93QT0dZR+AlfA,
	yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	cgroups-u79uwXL29TY76Z2rM5mHXA

On Mon, Dec 09, 2013 at 08:38:29PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
> 
> Add the missing unlock before return from function cgroup_load_subsys()
> in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>

Applied to cgroup/for-3.14.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2013-12-12 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-09 12:38 [PATCH -next] cgroup: fix missing unlock on error in cgroup_load_subsys() Wei Yongjun
     [not found] ` <CAPgLHd8s94-e2=tynt-jKKNmoSXzNFHs+vYeUS1uW3+Ohk_OVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-12-12  6:02   ` Li Zefan
2013-12-12 15:46   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).