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


Groups > linux.kernel > #1508655 > unrolled thread

[PATCH v2 2/2] staging: lustre: restore initialization of return code

Started byArnd Bergmann <arnd@arndb.de>
First post2016-10-25 23:30 +0200
Last post2016-10-25 23:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 2/2] staging: lustre: restore initialization of return code Arnd Bergmann <arnd@arndb.de> - 2016-10-25 23:30 +0200

#1508655 — [PATCH v2 2/2] staging: lustre: restore initialization of return code

FromArnd Bergmann <arnd@arndb.de>
Date2016-10-25 23:30 +0200
Subject[PATCH v2 2/2] staging: lustre: restore initialization of return code
Message-ID<swhsd-2CS-3@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web