cgroup: avoid null de-ref in css_rstat_exit()
PATCH 1/1 cgroup: avoid null de-ref in css_rstat_exit()
This function may be called asynchronously in scenarios where preceding calls to css_rstat_init() have not completed. Return early in this case.
Signed-off-by JP Kobryn <[email protected]>
Suggested-by Michal Koutný <[email protected]>
Fixes 5da3bfa029d68 ("cgroup: use separate rstat trees for each subsystem")
Reported-by [email protected]
--- kernel/cgroup/rstat.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/cgroup/rstat.c +3 -0
@@ -488,6 +488,9 @@ void css_rstat_exit(struct cgroup_subsys_state *css)if (!css_uses_rstat (css))return ; +if (!css->rstat_cpu) +return ; +css_rstat_flush (css);/* sanity check */
Signature · 1 line
2.47.3
Quoted 1 line · JP Kobryn
This function
Name the function i.e. css_rstat_exit()
Quoted 2 lines
may be called asynchronously in scenarios where preceding calls to
css_rstat_init()have not completed.
Explain some (or just one) of these scenarios in the commit.
Quoted 6 lines
Return early in this case.
Signed-off-by JP Kobryn <[email protected]>Suggested-by Michal Koutný <[email protected]>Fixes 5da3bfa029d68 ("cgroup: use separate rstat trees for each subsystem")Reported-by [email protected]
With the updated commit message, please include:
Acked-by Shakeel Butt <[email protected]>