From patchwork Fri Jan 1 12:47:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101215 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3943277lbb; Fri, 1 Jan 2016 04:48:28 -0800 (PST) X-Received: by 10.66.156.106 with SMTP id wd10mr107790248pab.150.1451652508314; Fri, 01 Jan 2016 04:48:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uz8si28712188pac.13.2016.01.01.04.48.27; Fri, 01 Jan 2016 04:48:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbcAAMsP (ORCPT + 29 others); Fri, 1 Jan 2016 07:48:15 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:49938 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbcAAMsM (ORCPT ); Fri, 1 Jan 2016 07:48:12 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0Lurx3-1a6Ufx23OL-01079y; Fri, 01 Jan 2016 13:47:44 +0100 From: Arnd Bergmann To: Jan Kara Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] udf: avoid uninitialized variable use Date: Fri, 01 Jan 2016 13:47:41 +0100 Message-ID: <9221187.T0u8gszVyj@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME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vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new warning about a real bug has come up from a recent cleanup: fs/udf/inode.c: In function 'udf_setup_indirect_aext': fs/udf/inode.c:1927:28: warning: 'adsize' may be used uninitialized in this function [-Wmaybe-uninitialized] If the alloc_type is neither ICBTAG_FLAG_AD_SHORT nor ICBTAG_FLAG_AD_LONG, the value of adsize is undefined. This changes the code to use zero for adsize in that case, which may be the correct solution, though I have not looked at the code in enough detail to know if it should be something else instead. Signed-off-by: Arnd Bergmann Fixes: fcea62babc81 ("udf: Factor out code for creating indirect extent") --- Found on ARM randconfig kernels starting with yesterday's linux-next -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 5b83351041a4..a1cc074c656f 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1890,6 +1890,8 @@ int udf_setup_indirect_aext(struct inode *inode, int block, adsize = sizeof(struct short_ad); else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG) adsize = sizeof(struct long_ad); + else + adsize = 0; neloc.logicalBlockNum = block; neloc.partitionReferenceNum = epos->block.partitionReferenceNum;