public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] cgroup: fix var may be used uninitialized warning
Date: Tue, 03 Mar 2015 16:12:49 +0100	[thread overview]
Message-ID: <54F5CF71.7060405@collabora.co.uk> (raw)
In-Reply-To: <20150303134642.GD3122@htj.duckdns.org>

Hello Tejun,

On 03/03/2015 02:46 PM, Tejun Heo wrote:
> On Tue, Mar 03, 2015 at 09:59:47AM +0100, Javier Martinez Canillas wrote:
>> When building cgroup, GCC warns that the root variable
>> may be used uninitialized in the cgroup_mount function.
>> 
>> kernel/cgroup.c: In function ‘cgroup_mount’:
>> kernel/cgroup.c:1886:13: warning: ‘root’ may be used uninitialized in this function [-Wuninitialized]
>> kernel/cgroup.c:1742:22: note: ‘root’ was declared here
>> 
>> This can never happen because if the struct cgroup_root
>> can't be allocated, ret is set to -ENOMEM and the error
>> returned so the code using root is not reachable. But
>> set root to NULL just to silence the compiler warning.
> 
> Which compiler are you on?
>

Yeah, I noticed that I was using a pretty old 4.7.2 GCC on
that machine and the warning indeed is not seen with 4.9.1.

Sorry for the noise...

> Thanks.
>

Best regard,
Javier

      reply	other threads:[~2015-03-03 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  8:59 [PATCH 1/1] cgroup: fix var may be used uninitialized warning Javier Martinez Canillas
2015-03-03 13:46 ` Tejun Heo
2015-03-03 15:12   ` Javier Martinez Canillas [this message]

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=54F5CF71.7060405@collabora.co.uk \
    --to=javier.martinez@collabora.co.uk \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=tj@kernel.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