Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934148AbcJQWnO (ORCPT ); Mon, 17 Oct 2016 18:43:14 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:56515 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932714AbcJQWnG (ORCPT ); Mon, 17 Oct 2016 18:43:06 -0400 From: Arnd Bergmann To: Oleg Drokin Cc: Linus Torvalds , linux-kernel@vger.kernel.org, "John L . Hammond" , Jinshan Xiong , James Simmons , Andreas Dilger , Greg Kroah-Hartman , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org Subject: [PATCH 08/28 v2] staging: lustre: restore initialization of return code Date: Tue, 18 Oct 2016 00:42:27 +0200 Message-ID: <17588627.UUHMZ6jH1R@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20161017220903.1746743-2-arnd@arndb.de> References: <20161017220342.1627073-1-arnd@arndb.de> <20161017220903.1746743-2-arnd@arndb.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:WIxCqH/rhQWV5phEAFKfjh1rrxiZYqk/6E0OMzbi4U55NUFeQue xCQueik7MsD8adYte4BnX3hWt4VY/APcI2NmaRBn+H0HFNlNG1jnx3IlZMT9jyGn/4YUqhn D//p4HduYibmlqMdKxZrgv00vwiaIVs5tVOM4Vyk8LEsyWgrtaqFHNxc/WWTl9T5VxW9+6b /7NjRASIeXK+2ggj3YJMQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:sb31ANLxvVw=:VYJ5ujb+qkn3gG0Jh4vYkE 7aksiPgYy4MMTKjvDrX52iKz4xroyY76SrcG4BUwZWr796PU5mwjbAOloust2CMVKnIdpqS4W MCc7nv0VAY8ZcVn7wRoVJSSKIuRn+oA9wINfhAp8HePcKIP+gSV/2Y8sXLraqmL+kqbEpWGWV UFV95114BkMo+RzMleczHGTUz/PNZ0CpvAgM7sNZrPDGU65JUa6hBzywX3Z6PER1LknOj5oIe n++FYTFOEXpA1D0O/Nx9BoNxVLKAz1Acb3YGDiR+OIaTYhLsamR/EilQF++KwKwuhW+uPbVwD Q4urRDDajUc1JxtvTMt+4+FVX8GxoUX+8182z4hJaCKjS2WmLPpWJQFEcflu0lTNKOiNIcJm3 mRowNdFXLfDFL5KC0+PdcAo5lh9rLVEwSvQXn4JoS492fy/Rs/g5kUoB7pBq6cxrE+mA9fzsf Ovuyrol8wLtwe9LouanAeguCz/6+ZEGcUZoLUOyVuPSw+1oGolNx+q2gbwVrwtkr1d3JuaqpV DWkaKOYOXazIcKneSCodTcXwnJGNF9IUKXoY/Q83YBCm7CrDeFCOJJeuhr9gscG3e4BA3ehQV orrR0zabJ9bmdOFP9V0SOPhzeMoQh7hY8vdKCPlSP4e5/epRaUpfrP9ziJ3X/WzDvlfPJ9mWH UvD+pBUvcu1hGB9KZ9o/a4PiAbioKkbCCEQAIvxDNS6tIRiHVrwX2h5hNOf/bmCiwYe1Ehei/ 48WeEE+LuV+fxf15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1102 Lines: 27 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 --- v2: fix embarrassing incorrect changelog 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);