Skip to contentSkip to conversation

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

DISCUSSION Stephen Rothwell 2 participants 2 messages Nov 22, 2016 Linux-next tree

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:

In file included from fs/overlayfs/dir.c:20:0:
fs/overlayfs/dir.c: In function 'ovl_set_redirect':
fs/overlayfs/overlayfs.h:92:6: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
int err = vfs_setxattr(dentry, name, value, size, flags);

      ^
fs/overlayfs/dir.c:788:14: note: 'ret' was declared here
  char *buf, *ret;
              ^

Introduced by commit

496654b0792e ("ovl: redirect on rename-dir")

This is not necessarily a false positive (although is is a confusing message): if the kmalloc of "buf" fails and samedir was not set in ovl_get_redirect(), then "return ret" will be executed but "ret" has not been set.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 14 lines · Stephen Rothwell

Hi Miklos,

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

In file included from fs/overlayfs/dir.c:20:0:
fs/overlayfs/dir.c: In function 'ovl_set_redirect':
fs/overlayfs/overlayfs.h:92:6: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
int err = vfs_setxattr(dentry, name, value, size, flags);

      ^
fs/overlayfs/dir.c:788:14: note: 'ret' was declared here
  char *buf, *ret;
              ^
Quoted 8 lines

Introduced by commit

496654b0792e ("ovl: redirect on rename-dir")

This is not necessarily a false positive (although is is a confusing message): if the kmalloc of "buf" fails and samedir was not set in ovl_get_redirect(), then "return ret" will be executed but "ret" has not been set.

Fixed. Thanks for reporting.

Miklos