From nobody Mon Feb 9 01:16:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604466629; cv=none; d=zohomail.com; s=zohoarc; b=BuwVh2P5pwmaKlxB1shkxeJVDXtjdK3W7ieyiFF/JqggpQuFdSNIN1VQcE9rVEh1ZuXVXEdN8mNt8VQv/Vk8W9SmfHFaaxBYpdlLqD5IKGbjOGjT/OVygm6JKRGNkLU9UiZEN8erAJOxnF1AU30AyL7j3VBOHPDjoB5+WUYRs7s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604466629; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4t5NY5zyTFxf5JdPvPR+dRhfn/ny8MSoW1vs+UM3VkI=; b=jNAbRyed28owP4TzgKGNZDB+oO0RaIz0wPcwWDhV4QxJO2Uis/Lrf3MlfdzcIw0XjiG36+ifQQWgB/eXf20n7hmu9gYTVXs23cA6YWwaZkLwq8/WCDvAh22b48vGzry2O7YhUPx/1QauQcf1q9OUtKFFk1CSVM+9BcrOizgXRDA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604466629798954.5230409303352; Tue, 3 Nov 2020 21:10:29 -0800 (PST) Received: from localhost ([::1]:44570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaB40-00006O-I0 for importer@patchew.org; Wed, 04 Nov 2020 00:10:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaAmI-00070g-Mj for qemu-devel@nongnu.org; Tue, 03 Nov 2020 23:52:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:46188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kaAmG-0004oe-0b for qemu-devel@nongnu.org; Tue, 03 Nov 2020 23:52:10 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-dPaoXGiPPXuIhfhmU4rDBg-1; Tue, 03 Nov 2020 23:51:16 -0500 Received: by mail-wr1-f69.google.com with SMTP id t11so8747070wrv.10 for ; Tue, 03 Nov 2020 20:51:16 -0800 (PST) Received: from redhat.com (bzq-79-176-118-93.red.bezeqint.net. [79.176.118.93]) by smtp.gmail.com with ESMTPSA id v6sm859879wrs.39.2020.11.03.20.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 20:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604465527; 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: in-reply-to:in-reply-to:references:references; bh=4t5NY5zyTFxf5JdPvPR+dRhfn/ny8MSoW1vs+UM3VkI=; b=O9de0IJ+xfXkT4wuYEBGQsEzzkta3WLIfNqHkyULx13t8SW499sbjVaL8+aLI0ap89YfKG WnKu6G4jGUYK1a8ONqvhvmvz1ltlR/Wru1XDne8Stc6uq1BlTN9hKsoXLQLygnb1cx+iqs B6QT/5gVBjEh2gwUlPN1TZMeLN+udUY= X-MC-Unique: dPaoXGiPPXuIhfhmU4rDBg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=4t5NY5zyTFxf5JdPvPR+dRhfn/ny8MSoW1vs+UM3VkI=; b=YY26dWFZdKTdxJszrfPGg5XIfEEerwTNeA39tQSBn5c292WQIr/WuWFczWAsJS11El tOQ+zPkMEFLMoWyUV1n/vfSLjC36Qkq0Xe1jHhMESU4S4mEuxasQX/ptwylQftsveC37 bIS96stBG447RRM71jRYCU4IWmelP6231s03MPZoTts6xxHZ6eFovZx2tUiPGegdFS/s RZGAHU3TR1X2F0EVASWdaCIFBzf5xoVoo3+jiztyIviVHa+f2NwRHghfNJEMjNVK4FYM JVe5fJUEuOvCRPpMOOTMB8FGKQn7BcIRJE6bFldAQ8/hp6kayNI5c6Mg0J7FNmWHyjRc Iakw== X-Gm-Message-State: AOAM530mgsv0bJ/HUI/Sf5WEZgqI1aIc10D4xRPt6Smdz4EOJrIxTd3k rxb6VUVWcV0GdLWchHieMySI3or3/A/LZEKxKdhRgz5TuD4rMjCJYDi+DGnXvpooDuhy2zeOg9U sgra/XUOJvNLgDFg= X-Received: by 2002:a1c:26c3:: with SMTP id m186mr2308226wmm.115.1604465475000; Tue, 03 Nov 2020 20:51:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB5LneqeIqlqxcFrlHeD6jODLPG3/6pQPGEz6Ef2D4s/NR30+VTEKZWVqkQ5D2j8GmxfBXRw== X-Received: by 2002:a1c:26c3:: with SMTP id m186mr2308213wmm.115.1604465474810; Tue, 03 Nov 2020 20:51:14 -0800 (PST) Date: Tue, 3 Nov 2020 23:51:12 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v2 11/38] hw/virtio/vhost-backend: Fix Coverity CID 1432871 Message-ID: <20201104044937.226370-12-mst@redhat.com> References: <20201104044937.226370-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201104044937.226370-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/03 22:09:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 Fix uninitialized value issues reported by Coverity: Field 'msg.reserved' is uninitialized when calling write(). While the 'struct vhost_msg' does not have a 'reserved' field, we still initialize it to have the two parts of the function consistent. Reported-by: Coverity (CID 1432864: UNINIT) Fixes: c471ad0e9bd ("vhost_net: device IOTLB support") Reviewed-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201103063541.2463363-1-philmd@redhat.com> Reviewed-by: Stefano Garzarella Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 88c8ecc9e0..222bbcc62d 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 MST