cgroup: Fix uninitialized variable warning
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Wed, 23 Dec 2015 21:53:27 +0000 (14:53 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 28 Dec 2015 15:42:07 +0000 (10:42 -0500)
commiteed67d75b66748a498a0592d9704081a98509444
tree098921068889614ab3d042c37ce6a73a1ad27e47
parent6bf024e69333f9371c634aa4cf04c95da86697f4
cgroup: Fix uninitialized variable warning

Commit 1f7dd3e5a6e4 ("cgroup: fix handling of multi-destination migration
from subtree_control enabling") introduced the following compiler warning:

mm/memcontrol.c: In function ‘mem_cgroup_can_attach’:
mm/memcontrol.c:4790:9: warning: ‘memcg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   mc.to = memcg;
         ^

Fix this by initializing 'memcg' to NULL.

This was found using gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6).

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/memcontrol.c