From: Dominique Martinet Date: Wed, 3 May 2023 07:49:27 +0000 (+0900) Subject: 9p: virtio: make sure 'offs' is initialized in zc_request X-Git-Tag: v4.14.326~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62d2f86c3af8d09c061997cbbd1ca899e92bf101;p=thirdparty%2Fkernel%2Fstable.git 9p: virtio: make sure 'offs' is initialized in zc_request [ 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 --- diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index c6a46e8e9eda5..25f5caa57289b 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -401,7 +401,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; p9_debug(P9_DEBUG_TRANS, "virtio request\n");