From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"open list:Network Block Dev..." <qemu-block@nongnu.org>,
"Max Reitz" <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH] nbd: fix uninitialized variable warning
Date: Tue, 16 Jul 2019 12:42:40 +0400 [thread overview]
Message-ID: <20190716084240.17594-1-marcandre.lureau@redhat.com> (raw)
../block/nbd.c: In function 'nbd_co_request':
../block/nbd.c:745:8: error: 'local_reply.type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (chunk->type == NBD_REPLY_TYPE_NONE) {
^
../block/nbd.c:710:14: note: 'local_reply.type' was declared here
NBDReply local_reply;
^~~~~~~~~~~
../block/nbd.c:710:14: error: 'local_reply.flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
../block/nbd.c:738:8: error: 'local_reply.<U4be0>.magic' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (nbd_reply_is_simple(reply) || s->quit) {
^
../block/nbd.c:710:14: note: 'local_reply.<U4be0>.magic' was declared here
NBDReply local_reply;
^~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
block/nbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/nbd.c b/block/nbd.c
index 81edabbf35..02eef09728 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -707,7 +707,7 @@ static bool nbd_reply_chunk_iter_receive(BDRVNBDState *s,
void **payload)
{
int ret, request_ret;
- NBDReply local_reply;
+ NBDReply local_reply = { 0, };
NBDStructuredReplyChunk *chunk;
Error *local_err = NULL;
if (s->quit) {
--
2.22.0.428.g6d5b264208
next reply other threads:[~2019-07-16 8:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 8:42 Marc-André Lureau [this message]
2019-07-16 9:19 ` [Qemu-devel] [PATCH] nbd: fix uninitialized variable warning Philippe Mathieu-Daudé
2019-07-16 10:06 ` Marc-André Lureau
2019-07-17 8:08 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190716084240.17594-1-marcandre.lureau@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).