Gcc complains:

qcow2raw.c: In function ‘main’:
qcow2raw.c:387:17: error: ‘buf’ may be used uninitialized in this function 
[-Werror=maybe-uninitialized]
    treq.buf     = buf;
                 ^

But at the point of that assignment, buf is a valid buffer allocated by
posix_memalign and filled in by read.

Signed-off-by: Wei Liu <wei.l...@citrix.com>
---
 tools/blktap2/drivers/img2qcow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/blktap2/drivers/img2qcow.c b/tools/blktap2/drivers/img2qcow.c
index 57b931e..7376382 100644
--- a/tools/blktap2/drivers/img2qcow.c
+++ b/tools/blktap2/drivers/img2qcow.c
@@ -166,7 +166,7 @@ int main(int argc, const char *argv[])
         int ret = -1, fd, len, err;
        struct timeval timeout;
        uint64_t i;
-       char *buf;
+       char *buf = NULL;
        td_request_t treq;
         td_disk_info_t info;
         td_vbd_request_t* vreq;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to