lkml.org 
[lkml]   [2009]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 22/24] HWPOISON: add memory cgroup filter
> +#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.

> + css_put(css);
> + return 0;
> +}


\
 
 \ /
  Last update: 2009-12-03 03:19    [W:0.106 / U:12.824 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site