qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/3] block/stream.c: ensure copy always set


From: alex . bennee
Subject: [Qemu-devel] [PATCH 3/3] block/stream.c: ensure copy always set
Date: Mon, 23 Sep 2013 17:07:30 +0100

From: Alex Bennée <address@hidden>

This only showed up when compiling with
--enable-trace-backend=stderr|ftrace at which point the compiler
complains with the following:

block/stream.c: In function ‘stream_run’:
block/stream.c:141:22: error: ‘copy’ may be used uninitialized in this function 
[-Werror=uninitialized]

Not sure exactly why it needs these options but it does seem clear the
negative return case should be handled.
---
 block/stream.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/stream.c b/block/stream.c
index 078ce4a..3b9c198 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -136,6 +136,8 @@ wait:
             }
 
             copy = (ret == 1);
+        } else {
+            copy = false;
         }
         trace_stream_one_iteration(s, sector_num, n, ret);
         if (ret >= 0 && copy) {
-- 
1.8.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]