Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527145 > unrolled thread

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

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2016-11-22 01:30 +0100
Last post2016-11-22 09:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build warning after merge of the overlayfs tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-11-22 01:30 +0100
    Re: linux-next: build warning after merge of the overlayfs tree Miklos Szeredi <miklos@szeredi.hu> - 2016-11-22 09:50 +0100

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

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2016-11-22 01:30 +0100
Subjectlinux-next: build warning after merge of the overlayfs tree
Message-ID<sG78e-8kM-9@gated-at.bofh.it>
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.

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1527308

FromMiklos Szeredi <miklos@szeredi.hu>
Date2016-11-22 09:50 +0100
Message-ID<sGeW5-4Pc-11@gated-at.bofh.it>
In reply to#1527145
On Tue, Nov 22, 2016 at 1:19 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 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.

Fixed. Thanks for reporting.

Miklos

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web