xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	cardoe@cardoe.com
Subject: [PATCH for-4.7 6/6] blktap2: initialise buf in qcow2raw.c:main
Date: Fri, 29 Apr 2016 16:11:17 +0100	[thread overview]
Message-ID: <1461942677-14564-7-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1461942677-14564-1-git-send-email-wei.liu2@citrix.com>

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 buf is a valid buffer allocated by posix_memalign at that point.

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

diff --git a/tools/blktap2/drivers/qcow2raw.c b/tools/blktap2/drivers/qcow2raw.c
index a2e417d..5ad7305 100644
--- a/tools/blktap2/drivers/qcow2raw.c
+++ b/tools/blktap2/drivers/qcow2raw.c
@@ -202,7 +202,7 @@ int main(int argc, const char *argv[])
 	uint64_t size;
 	struct timeval timeout;
 	uint64_t i;
-	char *buf;
+	char *buf = NULL;
 	struct stat finfo;
 	td_request_t treq;
 	td_vbd_request_t* vreq;
-- 
2.1.4


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

  parent reply	other threads:[~2016-04-29 15:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 15:11 [PATCH for-4.7 0/6] Workaround gcc -Wmaybe-uninitialised false positive reports Wei Liu
2016-04-29 15:11 ` [PATCH for-4.7 1/6] rombios/tcgbios: initialise size in tcpa_extend_acpi_log Wei Liu
2016-04-29 15:11 ` [PATCH for-4.7 2/6] rombios/tcgbios: initialise entry in HashLogEvent32 Wei Liu
2016-04-29 15:11 ` [PATCH for-4.7 3/6] rombios/tcgbios: initialise logdataptr " Wei Liu
2016-04-29 15:11 ` [PATCH for-4.7 4/6] blktap2: initialise buf in vhd_util_check_footer Wei Liu
2016-04-29 15:11 ` [PATCH for-4.7 5/6] blktap2: initialise buf to NULL in img2qcow.c:main Wei Liu
2016-04-29 15:11 ` Wei Liu [this message]
2016-05-06 11:15 ` [PATCH for-4.7 0/6] Workaround gcc -Wmaybe-uninitialised false positive reports Wei Liu
2016-05-06 13:37 ` Doug Goldstein
2016-05-06 14:48   ` Wei Liu

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=1461942677-14564-7-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=xen-devel@lists.xenproject.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).