From: Nathan Chancellor <natechancellor@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Yan, Zheng" <zyan@redhat.com>, Sage Weil <sage@redhat.com>,
Ilya Dryomov <idryomov@gmail.com>,
David Howells <dhowells@redhat.com>,
Al Viro <viro@zeniv.linux.org.uk>,
Jeff Layton <jlayton@kernel.org>,
Luis Henriques <lhenriques@suse.com>,
ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH] ceph: fix uninitialized return code
Date: Mon, 8 Jul 2019 07:50:03 -0700 [thread overview]
Message-ID: <20190708145003.GB43693@archlinux-epyc> (raw)
In-Reply-To: <20190708134821.587398-1-arnd@arndb.de>
On Mon, Jul 08, 2019 at 03:48:08PM +0200, Arnd Bergmann wrote:
> clang points out a -Wsometimed-uninitized bug in the modified
> ceph_real_mount() function:
>
> fs/ceph/super.c:850:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> if (!fsc->sb->s_root) {
> ^~~~~~~~~~~~~~~~
> fs/ceph/super.c:885:9: note: uninitialized use occurs here
> return err;
> ^~~
> fs/ceph/super.c:850:2: note: remove the 'if' if its condition is always true
> if (!fsc->sb->s_root) {
> ^~~~~~~~~~~~~~~~~~~~~~
> fs/ceph/super.c:843:9: note: initialize the variable 'err' to silence this warning
> int err;
> ^
> = 0
>
> Set it to zero if the condition is false.
>
> Fixes: 108f95bfaa56 ("vfs: Convert ceph to use the new mount API")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for the patch!
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
next prev parent reply other threads:[~2019-07-08 14:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 13:48 [PATCH] ceph: fix uninitialized return code Arnd Bergmann
2019-07-08 14:50 ` Nathan Chancellor [this message]
2019-07-08 17:16 ` Jeff Layton
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=20190708145003.GB43693@archlinux-epyc \
--to=natechancellor@gmail.com \
--cc=arnd@arndb.de \
--cc=ceph-devel@vger.kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=dhowells@redhat.com \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=lhenriques@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@redhat.com \
--cc=viro@zeniv.linux.org.uk \
--cc=zyan@redhat.com \
/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