diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 04a97bce2270..102ab48ffa13 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -6183,17 +6183,15 @@ static int memcg_write_event_control(struct cgroup_subsys_state *css, | |||
6183 | * automatically removed on cgroup destruction but the removal is | 6183 | * automatically removed on cgroup destruction but the removal is |
6184 | * asynchronous, so take an extra ref on @css. | 6184 | * asynchronous, so take an extra ref on @css. |
6185 | */ | 6185 | */ |
6186 | rcu_read_lock(); | 6186 | cfile_css = css_tryget_from_dir(cfile.file->f_dentry->d_parent, |
6187 | 6187 | &memory_cgrp_subsys); | |
6188 | ret = -EINVAL; | 6188 | ret = -EINVAL; |
6189 | cfile_css = css_from_dir(cfile.file->f_dentry->d_parent, | 6189 | if (IS_ERR(cfile_css)) |
6190 | &memory_cgrp_subsys); | ||
6191 | if (cfile_css == css && css_tryget(css)) | ||
6192 | ret = 0; | ||
6193 | |||
6194 | rcu_read_unlock(); | ||
6195 | if (ret) | ||
6196 | goto out_put_cfile; | 6190 | goto out_put_cfile; |
6191 | if (cfile_css != css) { | ||
6192 | css_put(cfile_css); | ||
6193 | goto out_put_cfile; | ||
6194 | } | ||
6197 | 6195 | ||
6198 | ret = event->register_event(memcg, event->eventfd, buffer); | 6196 | ret = event->register_event(memcg, event->eventfd, buffer); |
6199 | if (ret) | 6197 | if (ret) |