Messages in this thread | | | Date | Thu, 3 Dec 2009 10:20:32 +0800 | From | Wu Fengguang <> | Subject | Re: [PATCH 22/24] HWPOISON: add memory cgroup filter |
| |
On Thu, Dec 03, 2009 at 10:15:17AM +0800, Li Zefan wrote: > > +#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP > > +u32 hwpoison_filter_memcg; > > +static int hwpoison_filter_task(struct page *p) > > +{ > > + struct mem_cgroup *mem; > > + struct cgroup_subsys_state *css; > > + > > + if (!hwpoison_filter_memcg) > > + return 0; > > + > > + mem = try_get_mem_cgroup_from_page(p); > > + if (!mem) > > + return -EINVAL; > > + > > + css = mem_cgroup_css(mem); > > + if (!css) > > + return -EINVAL; > > + > > Here, if mem != NULL, then css won't be NULL.
Good catch, thank you!
> > + css_put(css); > > + return 0; > > +}
| |