All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: build warning after merge of the overlayfs tree
Date: Thu, 09 Nov 2017 09:29:14 +0530	[thread overview]
Message-ID: <2083901.R5B31B2umx@localhost.localdomain> (raw)
In-Reply-To: <20171109093306.178c9ad2@canb.auug.org.au>

On Thursday, November 9, 2017 4:03:06 AM IST Stephen Rothwell wrote:
> Hi Miklos,
> 
> After merging the overlayfs tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> fs/overlayfs/super.c: In function 'ovl_fill_super':
> fs/overlayfs/super.c:1070:25: warning: 'numlower' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   unsigned int stacklen, numlower, i;
>                          ^
> fs/overlayfs/super.c:1069:15: warning: 'stack' may be used uninitialized in this function [-Wmaybe-uninitialized]
>   struct path *stack;
>                ^
> 
> 

The following trivial patch resolves the warnings,

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index fd11c05..602e686 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1066,8 +1066,8 @@ static struct ovl_entry *ovl_get_lowerstack(struct super_block *sb,
 {
        int err;
        char *lowertmp, *lower;
-       struct path *stack;
-       unsigned int stacklen, numlower, i;
+       struct path *stack = NULL;
+       unsigned int stacklen, numlower = 0, i;
        bool remote = false;
        struct ovl_entry *oe;
 
-- 
chandan

  reply	other threads:[~2017-11-09  3:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 22:33 linux-next: build warning after merge of the overlayfs tree Stephen Rothwell
2017-11-09  3:59 ` Chandan Rajendra [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-20  6:38 Stephen Rothwell
2021-07-21 13:39 ` Miklos Szeredi
2021-03-29  9:14 Stephen Rothwell
2021-03-29  9:28 ` Miklos Szeredi
2021-03-31  0:16   ` Stephen Rothwell
2021-04-21  6:26 ` Stephen Rothwell
2017-05-17  0:19 Stephen Rothwell
2017-05-17  5:00 ` Amir Goldstein
2016-11-22  0:19 Stephen Rothwell
2016-11-22  8:41 ` Miklos Szeredi

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=2083901.R5B31B2umx@localhost.localdomain \
    --to=chandan@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.