qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhiwei Jiang <elish.jiang@ucloud.cn>
To: kwolf@redhat.com, mreitz@redhat.com, qemu-block@nongnu.org,
	qemu-devel@nongnu.org
Subject: [PATCH] block: fix build waring
Date: Sun, 13 Jun 2021 17:38:21 +0800	[thread overview]
Message-ID: <20210613093821.774562-1-elish.jiang@ucloud.cn> (raw)

when i compile this file with some error message
../block.c: In function ‘bdrv_replace_node_common’:
../block.c:4903:9: error: ‘to_cow_parent’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
         bdrv_remove_filter_or_cow_child(to_cow_parent, tran);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Zhiwei Jiang <elish.jiang@ucloud.cn>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 3f456892d0..08f29e6b65 100644
--- a/block.c
+++ b/block.c
@@ -4866,7 +4866,7 @@ static int bdrv_replace_node_common(BlockDriverState *from,
     Transaction *tran = tran_new();
     g_autoptr(GHashTable) found = NULL;
     g_autoptr(GSList) refresh_list = NULL;
-    BlockDriverState *to_cow_parent;
+    BlockDriverState *to_cow_parent = NULL;
     int ret;
 
     if (detach_subchain) {
-- 
2.25.1



             reply	other threads:[~2021-06-13 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13  9:38 Zhiwei Jiang [this message]
2021-06-13 15:03 ` [PATCH] block: fix build waring Peter Maydell
2021-06-14 18:39 ` Eric Blake

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=20210613093821.774562-1-elish.jiang@ucloud.cn \
    --to=elish.jiang@ucloud.cn \
    --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).