9p: virtio: make sure 'offs' is initialized in zc_request
authorDominique Martinet <asmadeus@codewreck.org>
Wed, 3 May 2023 07:49:27 +0000 (16:49 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:21 +0000 (09:42 +0200)
commit513eac8b85304dde069dc217e0423c7f7680b6ba
treef7118c867b7e05055dede9370788176c51d83f3e
parent05d88512e83377cc38c51fc757c3d8fee53b3287
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 <simon.horman@corigine.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/9p/trans_virtio.c