Skip to contentSkip to conversation

linux-next: build warning after merge of the overlayfs tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Nov 8, 2017 – Nov 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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;
               ^
Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 5 lines · IST Stephen Rothwell

Hi Miklos,

After merging the overlayfs tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

Quoted 9 lines

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,

fs/overlayfs/super.c +2 -2
index fd11c05..602e686 100644
@@ -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;
 
Signature · 1 line
chandan