Commit 54992762 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds
Browse files

memcg: add null check to page_cgroup_zoneinfo()

If CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y, page_cgroup::mem_cgroup can be NULL.
Therefore null checking is better.

A later patch uses this function.
Acked-by: default avatarKAMEZAWA Hiroyuki <>
Acked-by: default avatarRik van Riel <>
Signed-off-by: default avatarKOSAKI Motohiro <>
Cc: Balbir Singh <>
Cc: Daisuke Nishimura <>
Cc: Hugh Dickins <>
Cc: KOSAKI Motohiro <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent eeee9a8c
...@@ -231,6 +231,9 @@ page_cgroup_zoneinfo(struct page_cgroup *pc) ...@@ -231,6 +231,9 @@ page_cgroup_zoneinfo(struct page_cgroup *pc)
int nid = page_cgroup_nid(pc); int nid = page_cgroup_nid(pc);
int zid = page_cgroup_zid(pc); int zid = page_cgroup_zid(pc);
if (!mem)
return NULL;
return mem_cgroup_zoneinfo(mem, nid, zid); return mem_cgroup_zoneinfo(mem, nid, zid);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment