Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp486870rwr; Thu, 27 Apr 2023 04:25:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4r2iLWQ23Pks0o05WXAWirNe22EvAjYfZS7EpMyBu0JSFyXV7heYWNZdzUwVwIyRqjNJDJ X-Received: by 2002:a17:90a:1954:b0:244:b4ea:add4 with SMTP id 20-20020a17090a195400b00244b4eaadd4mr1437675pjh.3.1682594753366; Thu, 27 Apr 2023 04:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682594753; cv=none; d=google.com; s=arc-20160816; b=ZI/wx2967EmbDMB7vWk6XDDCzkiva1hxA+/saHrYYsjABLYbAoxUQ9EnSYFf0EEtjo +fdFyJL4QWRP7CVLkCrh3slXHAHmAyZZnHcwq05QJbAWfluQjNL7rwowRmNLl+Hsv4TG Py0DppX2bUpUYlWj8biCjQmcujbRzNDJD9eB6MF5iwbZM4X3xllrP8ohYAhTa839Cotw Pse/avUspYF3jIcFH1HToD9ofdzRoa89JY+ZND2bF+8wA0bUOAaJC3lga1mEI+2RLZk+ Bf2+LIaADko2Wwa4zMr0LQC248/w6YjFhjIuJkrJgIb8QKsINpjWvX8YjvKAPDZ4wU7F yUhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=ktwVTjkmEChjhY/kRpODTnUXv8zYYBOjSBS7MBgR468=; b=GTf8cTNxuRb5hkha+G0eM/h+JlQwCFJrcBn0TG6IJoy2YQa9MueCV4Oc5p/2E4fLe1 gQ7dzearLVU0n1XmkUMq8pemG8y9RFwMHslMH2MH8jdo29ZSyiQpQKD54O57VZq+V+Xl N3BMI20zjJ1+8d/eQUiAAwbqgu/7hatYUMWITyJzZO1aQGdC4iIPWKolzEg2QsrIge8v K+PWoFztG8vuix22KjJAsricG5XUgRVMBoBDe+ywD2yhRiT+NOg+rraxIHYL5RT9n3ag gqx/uLPdMmm8EhdPHSKfvfcnvo7nXAqZ3Z+HFAVqmbMza8kUSThs6yesfJtZ4twrclbg RT5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=YiL6ZYJi; dkim=pass header.i=@codewreck.org header.s=2 header.b=GaPAOn9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11-20020a17090a8a8b00b00246a6cecff8si18545834pjn.44.2023.04.27.04.25.40; Thu, 27 Apr 2023 04:25:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=YiL6ZYJi; dkim=pass header.i=@codewreck.org header.s=2 header.b=GaPAOn9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243709AbjD0LYS (ORCPT + 99 others); Thu, 27 Apr 2023 07:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243711AbjD0LYK (ORCPT ); Thu, 27 Apr 2023 07:24:10 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C2335FE0; Thu, 27 Apr 2023 04:24:03 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id 24C3FC021; Thu, 27 Apr 2023 13:24:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1682594640; bh=ktwVTjkmEChjhY/kRpODTnUXv8zYYBOjSBS7MBgR468=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YiL6ZYJi+YLRa0svXQ6itVhYqBapUedCZ4a+ZF/jn5/jg/WQccb6l3L6jcFfooyzu DrunOhIJfUZcnqtGy4jKULDC1x5RqQcft4G5S7CpVhu6hqS3q7AcJi5Y9ncYRLitJX 7TKlxFwaeEBLxbj0CdOpyAvSyBHMq7/T/iNzlDd2E6HRzWitgTMP5zk/Gk52ZS4mJd 3MygLf0G1/ye2m01NnAMMKv5HJKMTLcGEkhZfeEpz2Jxth9oXyz2fvbgxgFe8XYP9Q gcRgYiTVgn2wYP1LTuA1SiucHQDqZ//hogpK9yQswv5DR4ZNGsbJc2dsgpW+/8Y7oS YD1btsr+EUffg== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 2F438C009; Thu, 27 Apr 2023 13:23:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1682594639; bh=ktwVTjkmEChjhY/kRpODTnUXv8zYYBOjSBS7MBgR468=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GaPAOn9ax4E4wXFYH9FS+G/gn+WN8TnFfXvp/VD6Wr1pstK3XxHXSMVNHqAkxzUxb vXr7yXzu1V6sn6k7t5eY7xVCFHrn1aRD36Gi/ktPRn1mOaH97Zhj+ZJ07WiI+Sh/+7 PweTC8jln3zqzitON0FKtdXhM31TisXEoatiLlom7MaKFZLAKxw6OIylDIyTwT2+J0 KXBGojHZXOqAoAUiSNNynMQMhF3OIStrkizhMJP4vLxoEy+yeWa/j4lDXkHZGGS265 3IwECDv8OH2AzPyDfSDddoiAGaX8cSdWmyctMvvlThKxwwghlyQMpkO8ebxQXsQAvV 6NKgXWyaHiD2w== Received: from [127.0.0.2] (localhost [::1]) by odin.codewreck.org (OpenSMTPD) with ESMTP id d47cdf86; Thu, 27 Apr 2023 11:23:38 +0000 (UTC) From: Dominique Martinet Date: Thu, 27 Apr 2023 20:23:36 +0900 Subject: [PATCH 3/5] 9p: virtio: make sure 'offs' is initialized in zc_request MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230427-scan-build-v1-3-efa05d65e2da@codewreck.org> References: <20230427-scan-build-v1-0-efa05d65e2da@codewreck.org> In-Reply-To: <20230427-scan-build-v1-0-efa05d65e2da@codewreck.org> To: Eric Van Hensbergen , Latchesar Ionkov , Christian Schoenebeck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dominique Martinet X-Mailer: b4 0.13-dev-f371f X-Developer-Signature: v=1; a=openpgp-sha256; l=1151; i=asmadeus@codewreck.org; h=from:subject:message-id; bh=MTmAPJ1UlUfirYv8DGy7tXkrUTvjMEZVRvmnf3jNkLY=; b=owEBbQKS/ZANAwAIAatOm+xqmOZwAcsmYgBkSls6AeJis7+yhZZ2w56xFaCjuExc7wUz20f1l IVqwQ9n4JGJAjMEAAEIAB0WIQT8g9txgG5a3TOhiE6rTpvsapjmcAUCZEpbOgAKCRCrTpvsapjm cGisD/9Eq2d3KddRTicpI39DZzltwawS/nAxGl9GSeTqTSN4fm+hsRzlV6MHofvjXhxVCdsA7BO b/5apjazGZZIOD8cSC3LGikEEGhySt7vSuf0abg5Ux1/IekDadvtFVpnTSEYeILBE82+c9e4uyQ 6QKzx7VNOBriS0/Q3Q9MXiP1dEOoLIVJhxIWy/wJHGgx23Kx0k7JdNexzmrisfoWJerNhZN2N7w wZg4RvMrPJCyi5rvCs7NfAxP08M/91aYLqnYlRJl3nDrEJd7EsO6/gEcmlW3xm+UmVSHGULu4Em Ue2RWrTE9UderjLPqKiLvftYTHj5Cpyt5duZ6sU9h/bMMw4Z0IK/u++Lr9mYB+XGRWXBhdft9ZC uI+frkrXkGJP0NGFyIfrsDSbYs1Ma9ARicxfXFM2xXutUJZvpsF6aNBiIUK0XPS3nIRIjSt0HHD 4JJFvQ6zfkcb1hcNrfrntwneTVaYoBMlVoZHTdYOX1HmoOb88NH1QWHY2b7DgtBS/91dsGqLpIy x0cWtAMWp6WvdnwViuzJ038G+Hq6yvc+2bZBDerAgQc88Wo/EHpRivMWKmeJOAmHibF/PYtMNbM 4OKQmEhlz+Ho9beZRwgyqiIPxsJ4ZxydEl0ONnaa7eX10VgCyuq70KwBM4k3FEMw6yBgTU2Y2dL JXY+AQLEaBGbZbA== X-Developer-Key: i=asmadeus@codewreck.org; a=openpgp; fpr=B894379F662089525B3FB1B9333F1F391BBBB00A Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Similarly to the previous patch: offs can be used in handle_rerrors without initializing on small payloads; in this case handle_rerrors will not use it because of the size check, but it doesn't hurt to make sure it is zero to please scan-build. This fixes the following warning: net/9p/trans_virtio.c:539:3: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage] handle_rerror(req, in_hdr_len, offs, in_pages); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Dominique Martinet --- net/9p/trans_virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 2c9495ccda6b..f3f678289423 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -428,7 +428,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req, struct page **in_pages = NULL, **out_pages = NULL; struct virtio_chan *chan = client->trans; struct scatterlist *sgs[4]; - size_t offs; + size_t offs = 0; int need_drop = 0; int kicked = 0; -- 2.39.2