Messages in this thread Patch in this message | | | From | KOSAKI Motohiro <> | Subject | [PATCH 05/11] memcg: add null check to page_cgroup_zoneinfo() | Date | Mon, 1 Dec 2008 21:14:59 +0900 (JST) |
| |
if CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y, page_cgroup::mem_cgroup can be NULL. Therefore null checking is better.
latter patch use this function.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> --- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+)
Index: b/mm/memcontrol.c =================================================================== --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -231,6 +231,9 @@ page_cgroup_zoneinfo(struct page_cgroup int nid = page_cgroup_nid(pc); int zid = page_cgroup_zid(pc); + if (!mem) + return NULL; + return mem_cgroup_zoneinfo(mem, nid, zid); }
| |