summaryrefslogtreecommitdiffstats
path: root/nbd
diff options
context:
space:
mode:
authorChristian Borntraeger2020-09-30 17:58:57 +0200
committerEric Blake2020-10-09 22:04:32 +0200
commitbbc35fc20e6efcb9f177668c04ee05f25a0a2e65 (patch)
treeb3c68ce93396d5b7edf47a6db8ecc07651d89a93 /nbd
parentMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20201009' into... (diff)
downloadqemu-bbc35fc20e6efcb9f177668c04ee05f25a0a2e65.tar.gz
qemu-bbc35fc20e6efcb9f177668c04ee05f25a0a2e65.tar.xz
qemu-bbc35fc20e6efcb9f177668c04ee05f25a0a2e65.zip
nbd: silence maybe-uninitialized warnings
gcc 10 from Fedora 32 gives me: Compiling C object libblock.fa.p/nbd_server.c.o ../nbd/server.c: In function ‘nbd_co_client_start’: ../nbd/server.c:625:14: error: ‘namelen’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 625 | rc = nbd_negotiate_send_info(client, NBD_INFO_NAME, namelen, name, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 626 | errp); | ~~~~~ ../nbd/server.c:564:14: note: ‘namelen’ was declared here 564 | uint32_t namelen; | ^~~~~~~ cc1: all warnings being treated as errors As I cannot see how this can happen, let uns silence the warning. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-Id: <20200930155859.303148-3-borntraeger@de.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'nbd')
-rw-r--r--nbd/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nbd/server.c b/nbd/server.c
index f74766add7..f25cffa334 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -556,7 +556,7 @@ static int nbd_negotiate_handle_info(NBDClient *client, Error **errp)
NBDExport *exp;
uint16_t requests;
uint16_t request;
- uint32_t namelen;
+ uint32_t namelen = 0;
bool sendname = false;
bool blocksize = false;
uint32_t sizes[3];