]> Git Repo - linux.git/commit
memcg, tcp_kmem: check for cg_proto in sock_update_memcg
authorMichal Hocko <[email protected]>
Tue, 8 Sep 2015 22:01:13 +0000 (15:01 -0700)
committerLinus Torvalds <[email protected]>
Tue, 8 Sep 2015 22:35:28 +0000 (15:35 -0700)
commita03f1f058969ec350fb7451a6fbca23096ee5727
treeb6745897f8969fe99a4a514b9d76eaaa167ff84d
parent9f2115f93b88e5e8d48b87b153e36a537afb58cb
memcg, tcp_kmem: check for cg_proto in sock_update_memcg

sk_prot->proto_cgroup is allowed to return NULL but sock_update_memcg
doesn't check for NULL.  The function relies on the mem_cgroup_is_root
check because we shouldn't get NULL otherwise because mem_cgroup_from_task
will always return !NULL.

All other callers are checking for NULL and we can safely replace
mem_cgroup_is_root() check by cg_proto != NULL which will be more
straightforward (proto_cgroup returns NULL for the root memcg already).

Signed-off-by: Michal Hocko <[email protected]>
Reviewed-by: Vladimir Davydov <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memcontrol.c
This page took 0.054495 seconds and 4 git commands to generate.