From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDB4A848B; Sun, 13 Aug 2023 16:06:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08C02C433C8; Sun, 13 Aug 2023 16:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691942793; bh=WJTx7mSV102efOkE7AJn3zpmqnoRRtsjSNkP+ZJIQE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LDCvw3RpY1xMde/qCNd7ylHTvJ8sIyDU2Lddoo8gc1yB99JmjW1gasGzpZiXPegf1 9LrK43ozcMmdhdxlaAdlQ0q9FwgyRIuMTc93xAmewT0qx7zZq58L3rI/oB/n86EZ9p ebfNn7bSL/SfJ2F2S+0kqY/G2Jg8RRcEKTOBgJ1H2etPEFFkzF4yBkWDsqapV+1zOm UbMEioA/lTF5cnEIjxeXeA07bnDRB+PO3TgCVDWRn3rpxiYGcJ9jqXP24DNUGnW1pg p1lI5oXB5LKZBh8AwW4ftfnGaS+2FZcnDKEO4B+gpSMK4mTj48mj7jwOE4h6odF0az A2G4cGBbPXbHg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dominique Martinet , Simon Horman , Eric Van Hensbergen , Sasha Levin , lucho@ionkov.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, v9fs@lists.linux.dev, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 05/31] 9p: virtio: make sure 'offs' is initialized in zc_request Date: Sun, 13 Aug 2023 12:05:38 -0400 Message-Id: <20230813160605.1080385-5-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230813160605.1080385-1-sashal@kernel.org> References: <20230813160605.1080385-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.126 Content-Transfer-Encoding: 8bit From: Dominique Martinet [ Upstream commit 4a73edab69d3a6623f03817fe950a2d9585f80e4 ] 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); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Simon Horman Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen Signed-off-by: Sasha Levin --- 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 d110df3cb4e1d..96eecc2dcaa36 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -399,7 +399,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.40.1