Linux cgroups development
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Li Zefan <lizefan@huawei.com>,
	Daniel Wagner <daniel.wagner@bmw-carit.de>,
	Johannes Weiner <hannes@cmpxchg.org>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dave Jones <davej@codemonkey.org.uk>,
	kernel-team@fb.com, Aleksa Sarai <cyphar@cyphar.com>,
	Michal Hocko <mhocko@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH] cgroup: Fix uninitialized variable warning
Date: Wed, 23 Dec 2015 16:35:19 -0500	[thread overview]
Message-ID: <20151223213519.GM5003@mtj.duckdns.org> (raw)
In-Reply-To: <1450906240-21821-1-git-send-email-ross.zwisler@linux.intel.com>

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.

Please note which gcc version you were using in the commit description
and mark the init with a comment.

Thanks.

-- 
tejun

  reply	other threads:[~2015-12-23 21:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 21:30 [PATCH] cgroup: Fix uninitialized variable warning Ross Zwisler
2015-12-23 21:35 ` Tejun Heo [this message]
     [not found]   ` <20151223213519.GM5003-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2015-12-23 21:38     ` Ross Zwisler
     [not found]       ` <20151223213813.GA21287-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-12-23 21:41         ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2015-12-23 21:53 Ross Zwisler
     [not found] ` <1450907607-5060-1-git-send-email-ross.zwisler-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-12-28 15:45   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151223213519.GM5003@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=cyphar@cyphar.com \
    --cc=daniel.wagner@bmw-carit.de \
    --cc=davej@codemonkey.org.uk \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nhorman@tuxdriver.com \
    --cc=peterz@infradead.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox