Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

9p: virtio: make sure 'offs' is initialized in zc_request

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 <simon.horman@corigine.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>

authored by

Dominique Martinet and committed by
Eric Van Hensbergen
4a73edab 13ade4ac

+1 -1
+1 -1
net/9p/trans_virtio.c
··· 428 428 struct page **in_pages = NULL, **out_pages = NULL; 429 429 struct virtio_chan *chan = client->trans; 430 430 struct scatterlist *sgs[4]; 431 - size_t offs; 431 + size_t offs = 0; 432 432 int need_drop = 0; 433 433 int kicked = 0; 434 434