qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning
@ 2020-10-10 11:07 Chen Qun
  2020-10-11  1:55 ` Li Qiang
  2020-10-12 15:31 ` Laurent Vivier
  0 siblings, 2 replies; 9+ messages in thread
From: Chen Qun @ 2020-10-10 11:07 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: fam, ganqixin, vsementsov, zhang.zhanghailiang, qemu-block,
	quintela, dgilbert, mreitz, stefanha, Euler Robot, Chen Qun,
	jsnow

This if statement judgment is redundant and it will cause a warning:

migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used
 uninitialized in this function [-Wmaybe-uninitialized]
             g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
 migration/block-dirty-bitmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index 5bef793ac0..e09ea4f22b 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -1084,9 +1084,7 @@ static int dirty_bitmap_load_header(QEMUFile *f, DBMLoadState *s,
             } else {
                 bitmap_name = s->bitmap_alias;
             }
-        }
 
-        if (!s->cancelled) {
             g_strlcpy(s->bitmap_name, bitmap_name, sizeof(s->bitmap_name));
             s->bitmap = bdrv_find_dirty_bitmap(s->bs, s->bitmap_name);
 
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-13 11:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-10 11:07 [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning Chen Qun
2020-10-11  1:55 ` Li Qiang
2020-10-12 15:31 ` Laurent Vivier
2020-10-13  1:34   ` Li Qiang
2020-10-13  7:11     ` Laurent Vivier
2020-10-13  7:49       ` Chenqun (kuhn)
2020-10-13 11:32         ` Vladimir Sementsov-Ogievskiy
2020-10-13 11:49           ` Chenqun (kuhn)
2020-10-13  7:27     ` Chenqun (kuhn)

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).