From nobody Tue Apr 30 00:03:23 2024 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=1677759524; cv=none; d=zohomail.com; s=zohoarc; b=UoBefdo9W7BYEha7XugJ7dLJrFZJJgKPBkN9SQzARi2w1xhzIPr/Egy4UgvKBA1m5zZdpt5XbdlofunqGVUmSptFzGfpYZZS2etalDmqd44/Va5ybzde3yzpXmJQxZHXpZlRw3ACQ/1AWrdPYWsCKp2HpDtj8sgaKU7TnZRpybQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677759524; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=hLKw2DvFxtJO2P6P5lwBnmgXKGMV6JmxJOlmMQQAMaw=; b=kyu70xexsrerVjse6qE+V9RCkWTes5Dhl+oXVqAhWXoV/usOodGL69w+tHjj0Tu9d8He5qv5FaUhQI63fU0SvT9o5dNy0KNCKyUqWDU44HokNELZPV5rvRA4pbwEt31Gn6WEXPkjYYzz/Ys6BdGEFifwNoUW9V9h1FEh1cuIB18= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167775952496556.52322976855396; Thu, 2 Mar 2023 04:18:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXhtL-00068F-Hr; Thu, 02 Mar 2023 07:18:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXhtJ-00062S-MI for qemu-devel@nongnu.org; Thu, 02 Mar 2023 07:18:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXhtI-0004bm-2V for qemu-devel@nongnu.org; Thu, 02 Mar 2023 07:18:33 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-663-K1QQmfelPo-gnhcN0R9UoQ-1; Thu, 02 Mar 2023 07:17:21 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 875873C10247; Thu, 2 Mar 2023 12:17:21 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.226.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82089C16027; Thu, 2 Mar 2023 12:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677759510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hLKw2DvFxtJO2P6P5lwBnmgXKGMV6JmxJOlmMQQAMaw=; b=fQROQb3C9Ep3oaOw71x385TP6Y2L5HRRF4rUVb5ex8hinBnUsSdGWlUzfnhhUDV58CjX6Y iIm/4/xVREynTv0htl3TwCeFaTPveUt/c/Ds4osuEwOXc3KiSPxofLprAcdMYgI6xdgw// N5UTw5b/lIRVp/wKJjj2rJ+VD9HEOOY= X-MC-Unique: K1QQmfelPo-gnhcN0R9UoQ-1 From: Albert Esteve To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, "Michael S. Tsirkin" , Albert Esteve Subject: [PATCH] hw/virtio/vhost-user: avoid using unitialized errp Date: Thu, 2 Mar 2023 13:17:19 +0100 Message-Id: <20230302121719.9390-1-aesteve@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=170.10.129.124; envelope-from=aesteve@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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_H2=-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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1677759525532100001 Content-Type: text/plain; charset="utf-8" During protocol negotiation, when we the QEMU stub does not support a backend with F_CONFIG, it throws a warning and supresses the VHOST_USER_PROTOCOL_F_CONFIG bit. However, the warning uses warn_reportf_err macro and passes an unitialized errp pointer. However, the macro tries to edit the 'msg' member of the unitialized Error and segfaults. Instead, just use warn_report, which prints a warning message directly to the output. Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when support= ed") Signed-off-by: Albert Esteve Reviewed-by: Peter Maydell --- hw/virtio/vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index e68daa35d4..34c331b3ba 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -2031,8 +2031,8 @@ static int vhost_user_backend_init(struct vhost_dev *= dev, void *opaque, } else { if (virtio_has_feature(protocol_features, VHOST_USER_PROTOCOL_F_CONFIG)) { - warn_reportf_err(*errp, "vhost-user backend supports " - "VHOST_USER_PROTOCOL_F_CONFIG but QEMU do= es not."); + warn_report("vhost-user backend supports " + "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does no= t."); protocol_features &=3D ~(1ULL << VHOST_USER_PROTOCOL_F_CON= FIG); } } --=20 2.39.1