summaryrefslogtreecommitdiff
path: root/kernel/cgroup_freezer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r--kernel/cgroup_freezer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 9d3f61566fec..1db686e47a22 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -45,16 +45,19 @@ struct freezer {
spinlock_t lock;
};
+static inline struct freezer *css_freezer(struct cgroup_subsys_state *css)
+{
+ return css ? container_of(css, struct freezer, css) : NULL;
+}
+
static inline struct freezer *cgroup_freezer(struct cgroup *cgroup)
{
- return container_of(cgroup_css(cgroup, freezer_subsys_id),
- struct freezer, css);
+ return css_freezer(cgroup_css(cgroup, freezer_subsys_id));
}
static inline struct freezer *task_freezer(struct task_struct *task)
{
- return container_of(task_css(task, freezer_subsys_id),
- struct freezer, css);
+ return css_freezer(task_css(task, freezer_subsys_id));
}
static struct freezer *parent_freezer(struct freezer *freezer)