[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151223213813.GA21287@linux.intel.com>
Date: Wed, 23 Dec 2015 14:38:13 -0700
From: Ross Zwisler <ross.zwisler@...ux.intel.com>
To: Tejun Heo <tj@...nel.org>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
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: Re: [PATCH] cgroup: Fix uninitialized variable warning
On Wed, Dec 23, 2015 at 04:35:19PM -0500, Tejun Heo wrote:
> Hello, Ross.
>
> On Wed, Dec 23, 2015 at 02:30:40PM -0700, Ross Zwisler wrote:
> > static int mem_cgroup_can_attach(struct cgroup_taskset *tset)
> > {
> > struct cgroup_subsys_state *css;
> > - struct mem_cgroup *memcg;
> > + struct mem_cgroup *memcg = NULL;
>
> It's one thing to add spurious init to shut up gcc
>
> > @@ -4805,7 +4805,7 @@ static int mem_cgroup_can_attach(struct cgroup_taskset *tset)
> > p = leader;
> > memcg = mem_cgroup_from_css(css);
> > }
> > - if (!p)
> > + if (!p || !memcg)
>
> and to another to add an additional processing on it.
Do you believe that the additional processing is incorrect? If somehow we
*do* get through the above loop without setting memcg, the next deref will
OOPs the kernel...
--
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