qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>
Subject: [Qemu-devel] [PULL 01/16] kvm: Silence warning from valgrind
Date: Fri,  8 May 2015 14:07:46 +0200	[thread overview]
Message-ID: <1431086881-17922-2-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1431086881-17922-1-git-send-email-pbonzini@redhat.com>

From: Thomas Huth <thuth@redhat.com>

valgrind complains here about uninitialized bytes with the following message:

==17814== Syscall param ioctl(generic) points to uninitialised byte(s)
==17814==    at 0x466A780: ioctl (in /usr/lib64/power8/libc-2.17.so)
==17814==    by 0x100735B7: kvm_vm_ioctl (kvm-all.c:1920)
==17814==    by 0x10074583: kvm_set_ioeventfd_mmio (kvm-all.c:574)

Let's fix it by using a proper struct initializer in kvm_set_ioeventfd_mmio().

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1430153944-24368-1-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 kvm-all.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 3f7061a..28f4589 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -552,13 +552,13 @@ static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,
                                   bool assign, uint32_t size, bool datamatch)
 {
     int ret;
-    struct kvm_ioeventfd iofd;
-
-    iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0;
-    iofd.addr = addr;
-    iofd.len = size;
-    iofd.flags = 0;
-    iofd.fd = fd;
+    struct kvm_ioeventfd iofd = {
+        .datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0,
+        .addr = addr,
+        .len = size,
+        .flags = 0,
+        .fd = fd,
+    };
 
     if (!kvm_enabled()) {
         return -ENOSYS;
-- 
2.3.5

  reply	other threads:[~2015-05-08 12:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 12:07 [Qemu-devel] [PULL 00/16] KVM, QOM, NBD, build fixes for 2015-05-08 Paolo Bonzini
2015-05-08 12:07 ` Paolo Bonzini [this message]
2015-05-08 12:07 ` [Qemu-devel] [PULL 02/16] apic_common: improve readability of apic_reset_common Paolo Bonzini
2015-05-08 12:30   ` Andreas Färber
2015-05-08 12:07 ` [Qemu-devel] [PULL 03/16] mtree: tag & indent a bit better Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 04/16] mtree: also print disabled regions Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 05/16] kvm: add support for memory transaction attributes Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 06/16] exec: move rcu_read_lock/unlock to address_space_translate callers Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 07/16] configure: require __thread support Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 08/16] qom: fix typename of 'policy' enum property in hostmem obj Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 09/16] qom: document user creatable object types in help text Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 10/16] qom: create objects in two phases Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 11/16] qom: add object_new_propv / object_new_proplist constructors Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 12/16] qom: make enum string tables const-correct Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 13/16] qom: add a object_property_add_enum helper method Paolo Bonzini
2015-05-08 12:07 ` [Qemu-devel] [PULL 14/16] qom: don't pass string table to object_get_enum method Paolo Bonzini
2015-05-08 12:08 ` [Qemu-devel] [PULL 16/16] qemu-nbd: only send a limited number of errno codes on the wire Paolo Bonzini
2015-05-08 12:29 ` [Qemu-devel] [PULL 00/16] KVM, QOM, NBD, build fixes for 2015-05-08 Andreas Färber
2015-05-08 12:34   ` Daniel P. Berrange
2015-05-08 12:39     ` Andreas Färber
2015-05-08 12:42       ` Daniel P. Berrange
2015-05-12 16:57   ` Daniel P. Berrange

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=1431086881-17922-2-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).