public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Suggestion] kernel/cgroup.c: about kfree after 'get_new_cssid'
@ 2013-05-07 10:46 Chen Gang
  2013-05-07 11:01 ` Li Zefan
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Gang @ 2013-05-07 10:46 UTC (permalink / raw)
  To: tj, Li Zefan; +Cc: containers, cgroups, linux-kernel@vger.kernel.org

Hello Maintainers:

After call get_new_cssid(), I can not find the related free function
(it seems free_css_id() is for that, but not used).

The memory location is:
  get_new_cssid() --> kzalloc() for 'struct css_id'
  get_new_cssid() --> idr_alloc() for 'ss->idr'

One work flow:
  cgroup_load_subsys() --> cgroup_init_idr() --> get_new_cssid()
  when get_new_cssid() fails, it will:
  cgroup_load_subsys() --> cgroup_unload_subsys() --> idr_destroy(),
  and also:
  cgroup_load_subsys() --> cgroup_unload_subsys() --> ss->css_free();
    ('css_free' may 'debug_css_free', or 'freezer_css_free' ...)

It seems the work flow above is not 'kfree' 'struct css_id', is it true?

BTW: I also guess, for cgroup_init_idr() in cgroup_init(), need check
the return value.

Please help check.


Thanks.

--
 Chen Gang

 Asianux Corporation

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

end of thread, other threads:[~2013-05-08  2:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-07 10:46 [Suggestion] kernel/cgroup.c: about kfree after 'get_new_cssid' Chen Gang
2013-05-07 11:01 ` Li Zefan
2013-05-07 11:20   ` Chen Gang
2013-05-08  0:50     ` Li Zefan
2013-05-08  2:00       ` Chen Gang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox