[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/9] kvm: Silence warning from valgrind
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 1/9] kvm: Silence warning from valgrind |
Date: |
Fri, 8 May 2015 14:48:56 +0200 |
From: Thomas Huth <address@hidden>
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 <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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
- [Qemu-devel] [PULL v2 0/9] KVM, QOM, NBD, build fixes for 2015-05-08, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 1/9] kvm: Silence warning from valgrind,
Paolo Bonzini <=
- [Qemu-devel] [PULL 2/9] apic_common: improve readability of apic_reset_common, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 3/9] mtree: tag & indent a bit better, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 4/9] mtree: also print disabled regions, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 5/9] kvm: add support for memory transaction attributes, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 6/9] exec: move rcu_read_lock/unlock to address_space_translate callers, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 7/9] configure: require __thread support, Paolo Bonzini, 2015/05/08
- [Qemu-devel] [PULL 9/9] qemu-nbd: only send a limited number of errno codes on the wire, Paolo Bonzini, 2015/05/08