diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb_cgroup.c | 2 | ||||
-rw-r--r-- | mm/memcontrol.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index d2f9fc0b186e..95585a0b9c8d 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c | |||
@@ -36,7 +36,7 @@ static struct hugetlb_cgroup *root_h_cgroup __read_mostly; | |||
36 | static inline | 36 | static inline |
37 | struct hugetlb_cgroup *hugetlb_cgroup_from_css(struct cgroup_subsys_state *s) | 37 | struct hugetlb_cgroup *hugetlb_cgroup_from_css(struct cgroup_subsys_state *s) |
38 | { | 38 | { |
39 | return container_of(s, struct hugetlb_cgroup, css); | 39 | return s ? container_of(s, struct hugetlb_cgroup, css) : NULL; |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline | 42 | static inline |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b47bd3ad3c2b..11d659e3b08e 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -486,7 +486,7 @@ static DEFINE_MUTEX(memcg_create_mutex); | |||
486 | static inline | 486 | static inline |
487 | struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s) | 487 | struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s) |
488 | { | 488 | { |
489 | return container_of(s, struct mem_cgroup, css); | 489 | return s ? container_of(s, struct mem_cgroup, css) : NULL; |
490 | } | 490 | } |
491 | 491 | ||
492 | /* Some nice accessors for the vmpressure. */ | 492 | /* Some nice accessors for the vmpressure. */ |