From patchwork Fri May 8 12:07:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 470002 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1E2A7140281 for ; Fri, 8 May 2015 22:08:54 +1000 (AEST) Received: from localhost ([::1]:55287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqh5H-0006WM-Ni for incoming@patchwork.ozlabs.org; Fri, 08 May 2015 08:08:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqh4c-0005SP-EF for qemu-devel@nongnu.org; Fri, 08 May 2015 08:08:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yqh4Z-0003tz-UW for qemu-devel@nongnu.org; Fri, 08 May 2015 08:08:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqh4Z-0003tv-Nf for qemu-devel@nongnu.org; Fri, 08 May 2015 08:08:07 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t48C86JW005449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 8 May 2015 08:08:07 -0400 Received: from donizetti.redhat.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t48C82s4031193; Fri, 8 May 2015 08:08:05 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 8 May 2015 14:07:46 +0200 Message-Id: <1431086881-17922-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1431086881-17922-1-git-send-email-pbonzini@redhat.com> References: <1431086881-17922-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Thomas Huth Subject: [Qemu-devel] [PULL 01/16] kvm: Silence warning from valgrind X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth 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 Message-Id: <1430153944-24368-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini --- 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;