summaryrefslogtreecommitdiff
path: root/mm/swap_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swap_cgroup.c')
-rw-r--r--mm/swap_cgroup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/swap_cgroup.c b/mm/swap_cgroup.c
index db6c4a26cf59..da1278f0563b 100644
--- a/mm/swap_cgroup.c
+++ b/mm/swap_cgroup.c
@@ -161,6 +161,8 @@ unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
*/
unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
{
+ if (mem_cgroup_disabled())
+ return 0;
return lookup_swap_cgroup(ent, NULL)->id;
}