From: Arnd Bergmann <arnd@arndb.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Oleg Drokin <oleg.drokin@intel.com>,
Patrick Farrell <paf@cray.com>,
lustre-devel@lists.lustre.org, Bobi Jam <bobijam@hotmail.com>,
James Simmons <uja.ornl@yahoo.com>, Olaf Weber <olaf@sgi.com>,
James Simmons <jsimmons@infradead.org>,
Jinshan Xiong <jinshan.xiong@intel.com>,
"John L . Hammond" <john.hammond@intel.com>,
Liang Zhen <liang.zhen@intel.com>, Arnd Bergmann <arnd@arndb.de>,
Andreas Dilger <andreas.dilger@intel.com>,
Bobi Jam <bobijam.xu@intel.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] staging: lustre: restore initialization of return code
Date: Tue, 25 Oct 2016 23:22:31 +0200 [thread overview]
Message-ID: <20161025212310.2346367-2-arnd@arndb.de> (raw)
In-Reply-To: <20161025212310.2346367-1-arnd@arndb.de>
A recent rework removed the initialization of the successful return
code from lov_getstripe:
drivers/staging/lustre/lustre/lov/lov_pack.c: In function 'lov_getstripe':
drivers/staging/lustre/lustre/lov/lov_pack.c:426:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/staging/lustre/lustre/lov/lov_pack.c:313:6: note: 'rc' was declared here
This adds it back.
Fixes: e10a431b3fd0 ("staging: lustre: lov: move LSM to LOV layer")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/staging/lustre/lustre/lov/lov_pack.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c
index 17bceadd66f8..ccc1fae35791 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pack.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pack.c
@@ -418,6 +418,8 @@ int lov_getstripe(struct lov_object *obj, struct lov_stripe_md *lsm,
((struct lov_user_md *)lmmk)->lmm_stripe_count = lum.lmm_stripe_count;
if (copy_to_user(lump, lmmk, lmm_size))
rc = -EFAULT;
+ else
+ rc = 0;
out_free:
kvfree(lmmk);
--
2.9.0
next prev parent reply other threads:[~2016-10-25 21:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 21:22 [PATCH v2 1/2] staging: lustre: remove broken dead code in cfs_cpt_table_create_pattern Arnd Bergmann
2016-10-25 21:22 ` Arnd Bergmann [this message]
2016-10-27 13:12 ` Greg Kroah-Hartman
2016-10-27 13:36 ` Arnd Bergmann
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=20161025212310.2346367-2-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andreas.dilger@intel.com \
--cc=bobijam.xu@intel.com \
--cc=bobijam@hotmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jinshan.xiong@intel.com \
--cc=john.hammond@intel.com \
--cc=jsimmons@infradead.org \
--cc=liang.zhen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lustre-devel@lists.lustre.org \
--cc=olaf@sgi.com \
--cc=oleg.drokin@intel.com \
--cc=paf@cray.com \
--cc=uja.ornl@yahoo.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