From: Anthony PERARD <anthony.perard@citrix.com>
To: <qemu-devel@nongnu.org>
Cc: Peter Maydell <peter.maydell@linaro.org>, xen-devel@lists.xenproject.org
Subject: [PULL 2/3] xen-block: Fix uninitialized variable
Date: Tue, 7 Apr 2020 16:22:36 +0100 [thread overview]
Message-ID: <20200407152237.1468704-3-anthony.perard@citrix.com> (raw)
In-Reply-To: <20200407152237.1468704-1-anthony.perard@citrix.com>
Since 7f5d9b206d1e ("object-add: don't create return value if
failed"), qmp_object_add() don't write any value in 'ret_data', thus
has random data. Then qobject_unref() fails and abort().
Fix by initialising 'ret_data' properly.
Fixes: 5f07c4d60d09 ("qapi: Flatten object-add")
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200406164207.1446817-1-anthony.perard@citrix.com>
---
hw/block/xen-block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 07bb32e22b51..99cb4c67cb09 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -860,7 +860,7 @@ static XenBlockIOThread *xen_block_iothread_create(const char *id,
XenBlockIOThread *iothread = g_new(XenBlockIOThread, 1);
Error *local_err = NULL;
QDict *opts;
- QObject *ret_data;
+ QObject *ret_data = NULL;
iothread->id = g_strdup(id);
--
Anthony PERARD
next prev parent reply other threads:[~2020-04-07 15:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 15:22 [PULL 0/3] xen queue for 5.0 Anthony PERARD
2020-04-07 15:22 ` [PULL 1/3] hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() Anthony PERARD
2020-04-07 15:22 ` Anthony PERARD [this message]
2020-04-07 15:22 ` [PULL 3/3] MAINTAINERS: Add xen-usb.c to Xen section Anthony PERARD
2020-04-07 21:11 ` [PULL 0/3] xen queue for 5.0 Peter Maydell
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=20200407152237.1468704-3-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--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).