|
@@ -83,11 +83,12 @@ static inline
|
|
bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg)
|
|
bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg)
|
|
{
|
|
{
|
|
struct mem_cgroup *task_memcg;
|
|
struct mem_cgroup *task_memcg;
|
|
- bool match;
|
|
|
|
|
|
+ bool match = false;
|
|
|
|
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
|
|
task_memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
|
|
- match = __mem_cgroup_same_or_subtree(memcg, task_memcg);
|
|
|
|
|
|
+ if (task_memcg)
|
|
|
|
+ match = __mem_cgroup_same_or_subtree(memcg, task_memcg);
|
|
rcu_read_unlock();
|
|
rcu_read_unlock();
|
|
return match;
|
|
return match;
|
|
}
|
|
}
|