From: Alex Bennée <a...@bennee.com>

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