From nobody Fri May 17 03:54:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604349376; cv=none; d=zohomail.com; s=zohoarc; b=aFmohiPVfmhUm1j1P+QNpndq/UPUH3NQo2wUKyguMdeghsyoPoY9Gvbq24egm+c1jpllkYStZ7rKpB33ft3/5IzKIwGkPYtD2WnDA6I8qlCAanWZKDv0FUT+WFI4mEc+LB72pp2s6vjGdHUsZy8EiwzzZgLekZUdciOmJiCvItI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604349376; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=BU3kv5r4pwOUhlFCQ3R/8SVU+fQ/GS0GrUyOz60uz1E=; b=A+qawrt5cc3t9i3/B9FbBiPWIzD1svv+EXgwJaRa0U0qPqLY1i1LfHpqeVkX57o7YOyhnh8XxWzPCn3mh21KUpJJ9jnZ1HYp2lFSiXutQ1Z1W+LcZYvYyviqSK92NhqwZB6ZR6SvPiA1KQaBp0mPa/qE4oNyDkthP3NGpP4aN7Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1604349376634380.3411312000658; Mon, 2 Nov 2020 12:36:16 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-tfKMcJYKOeu7_yE5G2WQQw-1; Mon, 02 Nov 2020 15:36:13 -0500 Received: by mail-wr1-f70.google.com with SMTP id j13so6920109wrn.4 for ; Mon, 02 Nov 2020 12:36:12 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id x10sm22738918wrp.62.2020.11.02.12.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 12:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604349375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BU3kv5r4pwOUhlFCQ3R/8SVU+fQ/GS0GrUyOz60uz1E=; b=Ssb4m1hnU6+v6ZLc9U1kxyWie+d2bsDc7JvVKap7m1OFxobw09hzsUM3gNx+g2mFvCuvRe dEdmZ2YQ4XbnQiuQs8uohOjKZEz6ounKHbPXjLtt7vv3cgaSHQOdISTXT/ty+YScYSHJql Rw/ExTey8WrO34xzOfGcXLlL2TDXedU= X-MC-Unique: tfKMcJYKOeu7_yE5G2WQQw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BU3kv5r4pwOUhlFCQ3R/8SVU+fQ/GS0GrUyOz60uz1E=; b=PAZcF/M5J4Y9sqx/3L+NJFElpZJ2r1G8o1JKhOz1QYsdztwiUIlQIuUnV880HMBCP4 CZmvjTSnsEGqSpmHXMUDPMjASIdeUisUsjeKlwxYhAsOMMn7tXoUH8vxI4YSFrcwfBZk czzqwfNAVvZN18oyEMnKcx+1WrXsgnsVwLRFNch3Kl1ruSFIHw232Kh+B+KJ2Ml0HZgA axRmPaN3VMMczkVhjvcF0vjFpkJL9frzBjk05f3pTpaQqDKZixtAggmQgXWM1YJDXHly 5mZ1l/pem3uq5zQxe/g7ITYi320qKRv+pZw0NAuJD9zIoIm+IK/4JZiotsAoJLCroasz STCg== X-Gm-Message-State: AOAM532U6EQbHQi9wgceUg6xKLpwfSHP2lO1i0+4x/SCvyWtcMsljJJG eBtGI+jObtPl8OeH5zUp1bu2Jczs1KsPY0TuDEzkPQWw22GI2mVWC65CDXmswdZbsUBRGZtC1Am AxqWdLCvvPg3sJQ== X-Received: by 2002:adf:b109:: with SMTP id l9mr9364854wra.279.1604349371840; Mon, 02 Nov 2020 12:36:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT4uH0wNFvHO9xWbOQYEGYq8YE56GMSao42N/Al3Oi1HbomM0qZXevWYHxXzCAtce5LRITlA== X-Received: by 2002:adf:b109:: with SMTP id l9mr9364845wra.279.1604349371643; Mon, 02 Nov 2020 12:36:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-5.2] hw/virtio/vhost-backend: Fix Coverity CID 1432871 Date: Mon, 2 Nov 2020 21:36:09 +0100 Message-Id: <20201102203609.2228309-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Fix uninitialized value issues reported by Coverity: Field 'msg.reserved' is uninitialized when calling write(). Reported-by: Coverity (CID 1432864: UNINIT) Fixes: c471ad0e9bd ("vhost_net: device IOTLB support") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell --- hw/virtio/vhost-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index 88c8ecc9e03..222bbcc62de 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -257,7 +257,7 @@ static int vhost_kernel_send_device_iotlb_msg(struct vh= ost_dev *dev, struct vhost_iotlb_msg *imsg) { if (dev->backend_cap & (1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2)) { - struct vhost_msg_v2 msg; + struct vhost_msg_v2 msg =3D {}; =20 msg.type =3D VHOST_IOTLB_MSG_V2; msg.iotlb =3D *imsg; @@ -267,7 +267,7 @@ static int vhost_kernel_send_device_iotlb_msg(struct vh= ost_dev *dev, return -EFAULT; } } else { - struct vhost_msg msg; + struct vhost_msg msg =3D {}; =20 msg.type =3D VHOST_IOTLB_MSG; msg.iotlb =3D *imsg; --=20 2.26.2