From patchwork Wed Oct 25 11:57:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 158053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2542540vqx; Wed, 25 Oct 2023 04:57:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkuQMjAAiQJlasiU7jynekohqYN/eAYYxshDt1BlB8Wr6p3tbttDxTWrRbaUo8JcWVr+0h X-Received: by 2002:a0d:f582:0:b0:591:15a6:c11f with SMTP id e124-20020a0df582000000b0059115a6c11fmr13998831ywf.50.1698235054466; Wed, 25 Oct 2023 04:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698235054; cv=none; d=google.com; s=arc-20160816; b=Db+Sel5FSMlE6Tq5/cvsFztW258kasOOiYfvV3y1rOXljAOt2KgxKHWkcrgLYJOffD nfvtJVdKBYhC8MTzHz0zrG3gfZC7R524W3NzgU+202NY+rAnDyxKRcM3RrztwOqu2eW4 f3oA8qnpBCrNraQJQf8jGv0nVR1ObbswJLuHEWh8dWD4mb6I3dIbP4IKzokSKScIKLtC kotGbScFXgxQo0bdocgtP7IuZqi8g56SEN6KILPrQZuykCtc8Ym1UtAr1CJujL9Fffpe EbACi11ebmMRS0ULBVPG3qtXKOcDkptZbfDnf/Zwc8V754N4HqVnUYRgpqs5WlmDA1ls JtRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=Svgsq/AnbjJxNk7jNBD8VRF+Bt+Kn7+Y3XI8iU9eztQ=; fh=zt5wawTkMLdhSq8nwMzE5xzKSgLrINdoxKLf+u7xmTA=; b=KcacXsEzrVvR/TXFpZNGn8yR8DbW5LHsm9zbs9c3gUxrGaKM+MNQAQGHqX1fmejX6S hdqy+qVZcuyfPGb7cXHeBSqXCvxih4UOoH5fitbJD+ohsi7bqF5tCkcMoKi56XVH8/sr 0ra7uEk7XJGkythERr3b/Ec+RTR3QKoEEDwqRisYcWtOssHEe4kzOOLe1+8lqv2r7FAu 3A79fE9G7GuhLWiC0EMGHdU99wekw9AwGnFi2ArAR+aK34Txdp9fgZqg8LH9yMGPpTrc mc3EKqzq9LoxgReEhHDcCRocFFrlF53wdTzkfspzaHmNHBgOAC/7MymBlUjBL9JOwIy7 2aEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vUlwHCgC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id r68-20020a818147000000b005927a8ccfe9si10397076ywf.283.2023.10.25.04.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:57:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vUlwHCgC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D08F780C923F; Wed, 25 Oct 2023 04:57:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343657AbjJYL5U (ORCPT + 26 others); Wed, 25 Oct 2023 07:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234367AbjJYL5S (ORCPT ); Wed, 25 Oct 2023 07:57:18 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E380113A for ; Wed, 25 Oct 2023 04:57:15 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4079ed65582so43556995e9.1 for ; Wed, 25 Oct 2023 04:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698235034; x=1698839834; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Svgsq/AnbjJxNk7jNBD8VRF+Bt+Kn7+Y3XI8iU9eztQ=; b=vUlwHCgCCCdw2X0tNdXYkisy6XFt+e3S1dvHq+stYKsMTp9r6+mQShoiSgCdhkDipb sw8SiT5at93WvdeniWMrR+pB2ERs0383imTFtPpqKKLi5WLU6re2FehjP4y3CpsAntlJ QSlWlxzOGDfjIJOFFm17lDEhIDNMvClWdFhhFmrtSvEWAzSnpoUkSLcVNLi7S48YQFD/ c9FwhCP/wl+289DoJDzUW0eNOeJRxpVPsnwqs0HBMNL7PgUBET3o7F+rmZt+p/eoyVho HGIwBM1u8IBcWOs2R2Nz0WWNl0ONRU/i50xSonWeUrSW3lwdajRxCqbe1abskSIqJXeP Z7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698235034; x=1698839834; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Svgsq/AnbjJxNk7jNBD8VRF+Bt+Kn7+Y3XI8iU9eztQ=; b=fHfbJpByAjyHslih7xtFTOWN4uQos90c76f4sY7cjOWb+qzzD8M2llLXndL+fXBC7j 9SWJgarkocip+QbdPE5Ev/q9Gy+nNBruIkuX3efDiFfrzhYmGwQ3OjUSymuw+7t4KKbX QJ7Dsrjoc0yPecey9Ja14hKq+Lwz4t7JyQHcoJ6k6JD/lG3xyyF2Sh8PXPJfsJBMrd/F aObvQBPK4x7RowhR/05qXE9yZPMvT/vGaudKpaVqQqrBHkfAwUcRM6fuBko+Z2CEt6gr BSya6snRezMNPZxk0pPLDiMsJxQcCoTWrHI9e8lerP49d1u8l+kungAeGvOqtAbamQAq e/hw== X-Gm-Message-State: AOJu0YxNMwVg/9RDPJFbpWrWL0qNfwM3k+ixlUJ0KxMinLPKIo1w62Ov jmAaqpRD3pSaj4vZrdJtqk8PYg== X-Received: by 2002:a5d:6310:0:b0:32d:84c7:2f56 with SMTP id i16-20020a5d6310000000b0032d84c72f56mr11957241wru.21.1698235034491; Wed, 25 Oct 2023 04:57:14 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id n7-20020a5d6b87000000b003140f47224csm11843971wrx.15.2023.10.25.04.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 04:57:14 -0700 (PDT) Date: Wed, 25 Oct 2023 14:57:10 +0300 From: Dan Carpenter To: Andreas Gruenbacher Cc: Bob Peterson , gfs2@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] gfs2: uninitialized variable in __gfs2_iomap_get() Message-ID: <0b9cb1ea-4656-4802-b7a7-811c1e9e118a@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 25 Oct 2023 04:57:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780728520219747377 X-GMAIL-MSGID: 1780728520219747377 The "ret" variable is uninitialized when we goto out because gfs2_is_stuffed(ip). Fixes: 2cd225820b91 ("gfs2: Initialize metapaths outside of __gfs2_iomap_get") Signed-off-by: Dan Carpenter --- fs/gfs2/bmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index cef57d87c24d..12d7651e15e9 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -866,7 +866,7 @@ static int __gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length, __be64 *ptr; sector_t lblock; sector_t lblock_stop; - int ret; + int ret = 0; int eob; u64 len; struct buffer_head *bh;