From: Arnd Bergmann Date: Mon, 17 Oct 2016 22:42:27 +0000 (+0200) Subject: staging: lustre: restore initialization of return code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4bcd7e75cce12cc596144688a8167cef19e886c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: lustre: restore initialization of return code A recent rework dropped the initialization of the initialization of the successful return code in 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 Signed-off-by: Greg Kroah-Hartman --- 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);