[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1450907607-5060-1-git-send-email-ross.zwisler@linux.intel.com>
Date: Wed, 23 Dec 2015 14:53:27 -0700
From: Ross Zwisler <ross.zwisler@...ux.intel.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
Tejun Heo <tj@...nel.org>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>,
Li Zefan <lizefan@...wei.com>,
Daniel Wagner <daniel.wagner@...-carit.de>,
Johannes Weiner <hannes@...xchg.org>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, Dave Jones <davej@...emonkey.org.uk>,
kernel-team@...com, Aleksa Sarai <cyphar@...har.com>,
Michal Hocko <mhocko@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Neil Horman <nhorman@...driver.com>
Subject: [PATCH] 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@...ux.intel.com>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 48b22c3..ffd9750 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4735,7 +4735,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;
--
2.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists