summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorRoss Zwisler2015-12-23 22:53:27 +0100
committerTejun Heo2015-12-28 16:42:07 +0100
commiteed67d75b66748a498a0592d9704081a98509444 (patch)
tree098921068889614ab3d042c37ce6a73a1ad27e47 /mm/memcontrol.c
parentcgroup: put controller Kconfig options in meaningful order (diff)
downloadkernel-qcow2-linux-eed67d75b66748a498a0592d9704081a98509444.tar.gz
kernel-qcow2-linux-eed67d75b66748a498a0592d9704081a98509444.tar.xz
kernel-qcow2-linux-eed67d75b66748a498a0592d9704081a98509444.zip
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>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c92a65b2b4ab..7ca43ebe13c0 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4782,7 +4782,7 @@ static void mem_cgroup_clear_mc(void)
static int mem_cgroup_can_attach(struct cgroup_taskset *tset)
{
struct cgroup_subsys_state *css;
- struct mem_cgroup *memcg;
+ struct mem_cgroup *memcg = NULL; /* unneeded init to make gcc happy */
struct mem_cgroup *from;
struct task_struct *leader, *p;
struct mm_struct *mm;