From nobody Fri Nov 14 12:10:13 2025 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=1587756120; cv=none; d=zohomail.com; s=zohoarc; b=hYWDsPzy4If+vPBn1T3xCVYMbd7KAwqwyn5DC+SYRJP6avfY+HL0x+tV2vgAXqrUqCxxNKcKkn5YR5b7lxAeqsaxA9C9N9FEuc2WW28vwd0ofZ3B3Neu9iO7KKIPKqoDZ5Vf1HxTW+VtpG6kX8QKoSfXbZZGkH8e4kxulnAhWDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756120; 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=IiECJHG8o11LVFxA1H6ChVLhXqD1MUnm0fYZe+ffd2c=; b=cx7r1cefsJnNqNLjfT+tSaHdhXrpASm3DtlodWv4I3/do4fCiAjDLPXkmk30Nn+vvBATQEbCVWpK4GXNNXIve1MU5F5AsShxEOR5b22Z+rM8PzNId95qwSoQ22aMxlXMA9cBdMbXKk201xmLKKmuIuwmG/lqFbyZUlaupjfluXo= 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 1587756120639568.1993579077437; Fri, 24 Apr 2020 12:22:00 -0700 (PDT) Received: from localhost ([::1]:49662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3te-0005bB-9H for importer@patchew.org; Fri, 24 Apr 2020 15:21:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52948) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sJ-0003Oz-47 for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sI-00041q-Gc for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:34 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:36108 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sI-000411-3V for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:34 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-3guj8mXIPSeTnMZaJwmQHQ-1; Fri, 24 Apr 2020 15:20:30 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF996461; Fri, 24 Apr 2020 19:20:29 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FE7F390; Fri, 24 Apr 2020 19:20:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2A00611358BD; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756032; 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=IiECJHG8o11LVFxA1H6ChVLhXqD1MUnm0fYZe+ffd2c=; b=Xd382CjGag+NRIZIPdVHSbU3Xf0W9w9Slvq0cQhK5sWnKVH8QVyXs2ADP/jWaVTfPYpk7I 69kcQ7+eKl55fuwicJgErJA7ZZvMxhbKMQ1hUE86TsKZmfvU2CywbPleBaBNXk43xB7HR5 VsdQDiNTYWia955iDxbbdh+G7o+QHtM= X-MC-Unique: 3guj8mXIPSeTnMZaJwmQHQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 01/11] nvdimm: Plug memory leak in uuid property setter Date: Fri, 24 Apr 2020 21:20:17 +0200 Message-Id: <20200424192027.11404-2-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 02:57:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: Xiao Guangrong , Shivaprasad G Bhat Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" nvdimm_set_uuid() leaks memory on qemu_uuid_parse() failure. Fix that. Fixes: 6c5627bb24dcd68c997857a8b671617333b1289f Cc: Xiao Guangrong Cc: Shivaprasad G Bhat Signed-off-by: Markus Armbruster --- hw/mem/nvdimm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 8e426d24bb..d5752f7bf6 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -97,7 +97,6 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, cons= t char *name, if (qemu_uuid_parse(value, &nvdimm->uuid) !=3D 0) { error_setg(errp, "Property '%s.%s' has invalid value", object_get_typename(obj), name); - goto out; } g_free(value); =20 --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587756083; cv=none; d=zohomail.com; s=zohoarc; b=n8OI+IEmr3VB3OK6utDfiEhNzqac7z0KUQlyDh5FcL/eQ96HBALqvViN62jUG8lXg1OC57HQrVOlQ43WJpGfWJ0PtirtJj421BzkFeV6kxA38J2geFlHY/WkGBe66B5SrdVPBW9ULFhR6K4soN5Q2jKys5Muue/CtvZ8HCWWKsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756083; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JCs/MUWiOabJCVAQ8sLvUQgrb8weKuUkchaXXg61HdM=; b=hXLt5GFruble5FQpNHgDOyra3r5A73PNsLS2IDMmIxD54If5FCEmXOv9Bhbxfj/gCAmQYxfs5U97Oddq7NzRllf89RWJsHEl9SYhpHPnBHcI05ui7QWAnmebvmOpZV8xJ2evbR3aVQktT4obbFrkZVU10yrH0m4ZAh7iZxJXa/Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1587756083492184.61936789138292; Fri, 24 Apr 2020 12:21:23 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jS3sP-0006d6-HZ; Fri, 24 Apr 2020 19:20:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jS3sO-0006d1-TO for xen-devel@lists.xenproject.org; Fri, 24 Apr 2020 19:20:40 +0000 Received: from us-smtp-delivery-1.mimecast.com (unknown [207.211.31.120]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id af1ae10e-8660-11ea-94ff-12813bfff9fa; Fri, 24 Apr 2020 19:20:40 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-0hfApBy5PNeX1QqpGuxL5A-1; Fri, 24 Apr 2020 15:20:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E07684B8A0; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 742121A925; Fri, 24 Apr 2020 19:20:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2DB3011358BE; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) X-Inumbo-ID: af1ae10e-8660-11ea-94ff-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756039; 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=JCs/MUWiOabJCVAQ8sLvUQgrb8weKuUkchaXXg61HdM=; b=HfiW4QbjHna2jbBAEL2OUiajy2BviIqCw8Ci9M3+QkY2B7wWb0oqvuk8lXi7DUB0w3PRWz YRhrCqZsh8+Z1s54i4uxcwsbP13thJdcCdyQvWiSH8i92Fmlb46kdugMpgVIWkLAReiHGS q1Iik1A9T97qEUeBlwrvI2fB0yccwmg= X-MC-Unique: 0hfApBy5PNeX1QqpGuxL5A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 02/11] xen: Fix and improve handling of device_add usb-host errors Date: Fri, 24 Apr 2020 21:20:18 +0200 Message-Id: <20200424192027.11404-3-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony Perard , xen-devel@lists.xenproject.org, Stefano Stabellini , Gerd Hoffmann , Paul Durrant Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" usbback_portid_add() leaks the error when qdev_device_add() fails. Fix that. While there, use the error to improve the error message. The qemu_opts_from_qdict() similarly leaks on failure. But any failure there is a programming error. Pass &error_abort. Fixes: 816ac92ef769f9ffc534e49a1bb6177bddce7aa2 Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Gerd Hoffmann Cc: xen-devel@lists.xenproject.org Signed-off-by: Markus Armbruster --- hw/usb/xen-usb.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 961190d0f7..42643c3390 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -30,6 +30,7 @@ #include "hw/usb.h" #include "hw/xen/xen-legacy-backend.h" #include "monitor/qdev.h" +#include "qapi/error.h" #include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" =20 @@ -755,13 +756,15 @@ static void usbback_portid_add(struct usbback_info *u= sbif, unsigned port, qdict_put_int(qdict, "port", port); qdict_put_int(qdict, "hostbus", atoi(busid)); qdict_put_str(qdict, "hostport", portname); - opts =3D qemu_opts_from_qdict(qemu_find_opts("device"), qdict, &local_= err); - if (local_err) { - goto err; - } + opts =3D qemu_opts_from_qdict(qemu_find_opts("device"), qdict, + &error_abort); usbif->ports[port - 1].dev =3D USB_DEVICE(qdev_device_add(opts, &local= _err)); if (!usbif->ports[port - 1].dev) { - goto err; + qobject_unref(qdict); + xen_pv_printf(&usbif->xendev, 0, + "device %s could not be opened: %s\n", + busid, error_get_pretty(local_err)); + error_free(local_err); } qobject_unref(qdict); speed =3D usbif->ports[port - 1].dev->speed; @@ -793,11 +796,6 @@ static void usbback_portid_add(struct usbback_info *us= bif, unsigned port, usbback_hotplug_enq(usbif, port); =20 TR_BUS(&usbif->xendev, "port %d attached\n", port); - return; - -err: - qobject_unref(qdict); - xen_pv_printf(&usbif->xendev, 0, "device %s could not be opened\n", bu= sid); } =20 static void usbback_process_port(struct usbback_info *usbif, unsigned port) --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587756412; cv=none; d=zohomail.com; s=zohoarc; b=QeyV5KIfWeH8IsGAeKzEQTnKikoAB25CAS6aKooqRv/B3Yh+jvPsab/ll2+PoypTlwm4lumXM63fAe/nL7cFeOE9O2fOfkwenoyIR4LXz0tmgvN1VAc2qeJsbCoWFHp8drZ4iVi1NOsOE3RPhHh0bqZoqnzWWeqPkxDWCg94JRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756412; 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=nIGapMzDofjp/ghREMvtjE5FNZiHL0mZUvxZbHgl4Hs=; b=hjtGkEP/0OF3CkOKvFEBa4puw7MVs+9Jl7D5tqrUa9XZsQF5Wb7xN4rqEoxHnQIgX2r/9yCLe0iEjXWtkfhNwFkBjAUo/WAUnwWLowcIphTNl8XIbencn2ENt2h8p1ICA9lK7JK4xRyCnt/X55oNg97RhXdWAs0kZTAnrb2OJPA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1587756412910339.34104710528914; Fri, 24 Apr 2020 12:26:52 -0700 (PDT) Received: from localhost ([::1]:50204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3yN-0001VN-IZ for importer@patchew.org; Fri, 24 Apr 2020 15:26:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52974) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sL-0003RG-PP for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sL-00044k-Au for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:37 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:43630 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sK-00043f-Tv for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-mRAiuoVTNm2vRpBpT0rz7w-1; Fri, 24 Apr 2020 15:20:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66CA7460 for ; Fri, 24 Apr 2020 19:20:33 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BC875EDE0; Fri, 24 Apr 2020 19:20:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 30EC911358BF; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756036; 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=nIGapMzDofjp/ghREMvtjE5FNZiHL0mZUvxZbHgl4Hs=; b=iUkWrooTbZXtlWllGRyrOZuw8XcjrrmPQwU0QT7qNtsvXFriaG2vKzBD8mYmnTjr1mqcFi swebJCEA+UKyeJ5YO+yV9ZEFs4I9Qyj8b2/QvbAReykdISkWdHuxAtnm45eYUm/bU7ywJk tHt2/cBRiS/a/Ai80JR3DPW8DvTgg5k= X-MC-Unique: mRAiuoVTNm2vRpBpT0rz7w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 03/11] s390x/cpumodel: Fix harmless misuse of visit_check_struct() Date: Fri, 24 Apr 2020 21:20:19 +0200 Message-Id: <20200424192027.11404-4-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 13:45:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Cornelia Huck , David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit e47970f51d "s390x/cpumodel: Fix query-cpu-model-FOO error API violations" neglected to change visit_end_struct()'s Error ** argument along with the others. If visit_end_struct() failed, we'd take the success path. Fortunately, it can't fail here: qobject_input_check_struct() checks we consumed the whole dictionary, and to get here, we did. Fix it anyway. Cc: David Hildenbrand Cc: Cornelia Huck Signed-off-by: Markus Armbruster Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand --- target/s390x/cpu_models.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7c32180269..87a8028ad3 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -524,7 +524,7 @@ static void cpu_model_from_info(S390CPUModel *model, co= nst CpuModelInfo *info, } } if (!err) { - visit_check_struct(visitor, errp); + visit_check_struct(visitor, &err); } visit_end_struct(visitor, NULL); visit_free(visitor); --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587756117; cv=none; d=zohomail.com; s=zohoarc; b=UjNu5n9/qycd9qML4+zMjUCCCg6rIg/abgrUL4nz/mOiqrop0C836sZWac6fxfs/VLoyOALinCp/cNFmYeZkf9WTw1F/KdPreAR335RTpbKl0G8+E1hTzN714+Tq+zPK+J8r5FvRebLt6DEHhW3KDwN5kHGEQvlmQkYTFJq52hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756117; 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=D1BLmcfF9t5WFrwAI8NggmLFoG9Kltff0YkgQ4xcOAs=; b=bXKNLV5DGe+mzwjqpdITOwMYS6ctnDN/P/dgrSi6BgN4SSAH08pcRJrOqRi5LvDQqJ01IcPu3S1JGTyrhSRJr5+ydR8ae6xkS9Dp8AVQZPDherd0C78i8m9eBgR+P/BUkLN46HftUQnGKVO0HYJRtObmI8nm+hHgEuoQFAwGn2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1587756117719103.492868734549; Fri, 24 Apr 2020 12:21:57 -0700 (PDT) Received: from localhost ([::1]:49654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3tb-0005T7-K1 for importer@patchew.org; Fri, 24 Apr 2020 15:21:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52942) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sJ-0003ON-2J for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sI-00041k-EV for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:34 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:49867 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sH-00040f-UR for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:34 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-4SVaCpbxOt-1tpMUrvcpNg-1; Fri, 24 Apr 2020 15:20:30 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D22001899525; Fri, 24 Apr 2020 19:20:29 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78085397; Fri, 24 Apr 2020 19:20:29 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3447311358C0; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756032; 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=D1BLmcfF9t5WFrwAI8NggmLFoG9Kltff0YkgQ4xcOAs=; b=CXLG3uK/X48Vy6ER9O3oy23h+CFdp7OyslftrnLZ6KPmCz5pQ17Ene8wnfGi2iTCOxMd1X 9+23BOW1oCtkrJCAV252WIXVlDh1T/kZJpaTPKh9bE0PtfrazTDH280pxAlN9B8o6quOfF gnbgyKrNYIYL02Xa5kNvdU/y8qwjS+s= X-MC-Unique: 4SVaCpbxOt-1tpMUrvcpNg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 04/11] s390x/pci: Fix harmless mistake in zpci's property fid's setter Date: Fri, 24 Apr 2020 21:20:20 +0200 Message-Id: <20200424192027.11404-5-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.81; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 13:45:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Cornelia Huck , Matthew Rosato Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" s390_pci_set_fid() sets zpci->fid_defined to true even when visit_type_uint32() failed. Reproducer: "-device zpci,fid=3Djunk". Harmless in practice, because qdev_device_add() then fails, throwing away @zpci. Fix it anyway. Cc: Matthew Rosato Cc: Cornelia Huck Signed-off-by: Markus Armbruster --- hw/s390x/s390-pci-bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index ed8be124da..19ee1f02bb 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1276,7 +1276,9 @@ static void s390_pci_set_fid(Object *obj, Visitor *v,= const char *name, return; } =20 - visit_type_uint32(v, name, ptr, errp); + if (!visit_type_uint32(v, name, ptr, errp)) { + return; + } zpci->fid_defined =3D true; } =20 --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 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=1587756225; cv=none; d=zohomail.com; s=zohoarc; b=jBzmXhmDsGdBjcLdnByJReftLQdlAU/e5xeR0QxI5vNC0p19r8kdn7PckWgJZ4Dk0kWn5nlvka56Jep//YtZXstNroY11F1DGoaL8pDRI4dgxF8rEfYnAocZkQOxaa1Th2L+MBKFDXwNmfyiPWZPiBqL78dtNcapWu7+UNpxBW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756225; h=Content-Type:Content-Transfer-Encoding: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=Zz6PIHu4D9IJMAUYz5GlS7tUaH56am6CeocpGy7vUGA=; b=WRUNH+aVXOnJYpvcLBUdUYN7fwSpZx3WPl/W8iLjcGfLvfnS3IbwZu/1hk2iEdU+8ipLUIUKYa6EnDKHGyJm+DyRaghbxtFKSJRKKwZ39kI+ChS1pHUehX+pXKL1Thwu7aB0Q8ib8oIzZykgGJkU4osQ5ZfYTs0OcNQPZ5rahbM= 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 1587756225832387.9864644056021; Fri, 24 Apr 2020 12:23:45 -0700 (PDT) Received: from localhost ([::1]:49864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3vM-0001sz-CD for importer@patchew.org; Fri, 24 Apr 2020 15:23:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52956) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sK-0003PX-7l for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sJ-00043L-Oj for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:58888 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sJ-00041x-8q for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-wQXZRtGYODiiH5cS1TWTug-1; Fri, 24 Apr 2020 15:20:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EDB11005510 for ; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF53A605CF for ; Fri, 24 Apr 2020 19:20:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3776811358C1; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zz6PIHu4D9IJMAUYz5GlS7tUaH56am6CeocpGy7vUGA=; b=PenBfbKVp8irDfpJLbvIhA1Q1Zfk/p6Scx1HEgDs2YtWbxGjU2zooaC7EU+1nTjXMer4se dwG+wa9pPr7oRJp7WXdXmfRKCDO7Jb/k+SPJDiOy2D1ylunVemIEytAk0QgtO/4h/xb5By OYVHC5hitIW+1WjKSHcP7LDrOrf+6og= X-MC-Unique: wQXZRtGYODiiH5cS1TWTug-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 05/11] tests/migration: Tighten error checking Date: Fri, 24 Apr 2020 21:20:21 +0200 Message-Id: <20200424192027.11404-6-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 02:57:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" migrate_get_socket_address() neglects to check visit_type_SocketAddressList() failure. This smells like a leak, but it actually will crash dereferencing @addrs. Pass &error_abort to remove the code smell. Signed-off-by: Markus Armbruster --- tests/qtest/migration-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 2568c9529c..dc3490c9fa 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" =20 #include "libqtest.h" +#include "qapi/error.h" #include "qapi/qmp/qdict.h" #include "qemu/module.h" #include "qemu/option.h" @@ -301,7 +302,6 @@ static char *migrate_get_socket_address(QTestState *who= , const char *parameter) { QDict *rsp; char *result; - Error *local_err =3D NULL; SocketAddressList *addrs; Visitor *iv =3D NULL; QObject *object; @@ -310,7 +310,7 @@ static char *migrate_get_socket_address(QTestState *who= , const char *parameter) object =3D qdict_get(rsp, parameter); =20 iv =3D qobject_input_visitor_new(object); - visit_type_SocketAddressList(iv, NULL, &addrs, &local_err); + visit_type_SocketAddressList(iv, NULL, &addrs, &error_abort); visit_free(iv); =20 /* we are only using a single address */ --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 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=1587756324; cv=none; d=zohomail.com; s=zohoarc; b=Q/Pvy+gDqfh4wV9BPA2Z4a7IAYWo0+UOlAZZH6Qzba95TFEK0XrXy/DyBb5EyFf/hV5hqjzg+uKDyFWfIsR2PtGRFM7bmDoKj3X3lSysaTGQRCmVS9cDoCHXtix9dlfUL15QrV739SWtR6eFUJI6sIY6qi7WURYFjS5NodHhCy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756324; h=Content-Type:Content-Transfer-Encoding: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=fB315KRVGIuXLd9HKrQXdHU8MjVh07f8uGByCmBHz1I=; b=HNBaBPqP1reZy0/wV26ZsWcxtuSdBecDZXkZS9jsPOTlkWS4WZHxSA/cqP+MJAiz9LHLFBEg9YS5H2fC5qR41kPlwsSJBWQAlU3SqOTK3a5psFD4a1jDMvYya7YveZUr7coKjJ0XtRo47Uj69NesXTyCKS0eymxM/NgYDsFgo/g= 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 1587756324087874.6443054589256; Fri, 24 Apr 2020 12:25:24 -0700 (PDT) Received: from localhost ([::1]:50046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3ww-00065b-OR for importer@patchew.org; Fri, 24 Apr 2020 15:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52962) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sK-0003Pz-Ix for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sJ-00043W-QG for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:47446 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sJ-000423-Bx for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-fi9QRMUSMs21JokJZ7QwHA-1; Fri, 24 Apr 2020 15:20:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B9BE45F for ; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF7E75D9CA for ; Fri, 24 Apr 2020 19:20:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3AC7811358C2; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fB315KRVGIuXLd9HKrQXdHU8MjVh07f8uGByCmBHz1I=; b=dj26zjafEuHwFvmxSFaWXLZpC/5sE0GVfzZ8tocEzef6eKwpT3zqdGPKrOBdkTIpnTHh1h tX1SNTmQG2uSBQVgVQIOj0FvV4VuDcleJyLqa7hNeY2R9cpV8otGhJjAFZkreuWKYhzAU1 8sDY2c3HOhbthf99o7ZSowwufqY/8EU= X-MC-Unique: fi9QRMUSMs21JokJZ7QwHA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 06/11] error: Use error_reportf_err() where appropriate Date: Fri, 24 Apr 2020 21:20:22 +0200 Message-Id: <20200424192027.11404-7-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.81; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 13:45:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Replace error_report("...: %s", ..., error_get_pretty(err)); by error_reportf_err(err, "...: ", ...); Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- chardev/char-socket.c | 5 +++-- hw/sd/pxa2xx_mmci.c | 4 ++-- hw/sd/sd.c | 4 ++-- hw/usb/dev-mtp.c | 9 +++++---- qemu-nbd.c | 7 +++---- scsi/qemu-pr-helper.c | 4 ++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 185fe38dda..e5ee685f8c 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -138,8 +138,9 @@ static void check_report_connect_error(Chardev *chr, SocketChardev *s =3D SOCKET_CHARDEV(chr); =20 if (!s->connect_err_reported) { - error_report("Unable to connect character device %s: %s", - chr->label, error_get_pretty(err)); + error_reportf_err(err, + "Unable to connect character device %s: ", + chr->label); s->connect_err_reported =3D true; } qemu_chr_socket_restart_timer(chr); diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 8f9ab0ec16..f9c50ddda5 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -497,12 +497,12 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysme= m, carddev =3D qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CAR= D); qdev_prop_set_drive(carddev, "drive", blk, &err); if (err) { - error_report("failed to init SD card: %s", error_get_pretty(err)); + error_reportf_err(err, "failed to init SD card: "); return NULL; } object_property_set_bool(OBJECT(carddev), true, "realized", &err); if (err) { - error_report("failed to init SD card: %s", error_get_pretty(err)); + error_reportf_err(err, "failed to init SD card: "); return NULL; } =20 diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 71a9af09ab..3c06a0ac6d 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -703,13 +703,13 @@ SDState *sd_init(BlockBackend *blk, bool is_spi) dev =3D DEVICE(obj); qdev_prop_set_drive(dev, "drive", blk, &err); if (err) { - error_report("sd_init failed: %s", error_get_pretty(err)); + error_reportf_err(err, "sd_init failed: "); return NULL; } qdev_prop_set_bit(dev, "spi", is_spi); object_property_set_bool(obj, true, "realized", &err); if (err) { - error_report("sd_init failed: %s", error_get_pretty(err)); + error_reportf_err(err, "sd_init failed: "); return NULL; } =20 diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 20717f026b..168428156b 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -631,8 +631,9 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObje= ct *o) int64_t id =3D qemu_file_monitor_add_watch(s->file_monitor, o->pat= h, NULL, file_monitor_event, s, &e= rr); if (id =3D=3D -1) { - error_report("usb-mtp: failed to add watch for %s: %s", o->pat= h, - error_get_pretty(err)); + error_reportf_err(err, + "usb-mtp: failed to add watch for %s: ", + o->path); error_free(err); } else { trace_usb_mtp_file_monitor_event(s->dev.addr, o->path, @@ -1276,8 +1277,8 @@ static void usb_mtp_command(MTPState *s, MTPControl *= c) =20 s->file_monitor =3D qemu_file_monitor_new(&err); if (err) { - error_report("usb-mtp: file monitoring init failed: %s", - error_get_pretty(err)); + error_reportf_err(err, + "usb-mtp: file monitoring init failed: "); error_free(err); } else { QTAILQ_INIT(&s->events); diff --git a/qemu-nbd.c b/qemu-nbd.c index 4aa005004e..30deb5d9e6 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -856,8 +856,7 @@ int main(int argc, char **argv) } tlscreds =3D nbd_get_tls_creds(tlscredsid, list, &local_err); if (local_err) { - error_report("Failed to get TLS creds %s", - error_get_pretty(local_err)); + error_reportf_err(local_err, "Failed to get TLS creds "); exit(EXIT_FAILURE); } } else { @@ -979,8 +978,8 @@ int main(int argc, char **argv) &local_err); if (sioc =3D=3D NULL) { object_unref(OBJECT(server)); - error_report("Failed to use socket activation: %s", - error_get_pretty(local_err)); + error_reportf_err(local_err, + "Failed to use socket activation: "); exit(EXIT_FAILURE); } qio_net_listener_add(server, sioc); diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 181ed4a186..57ad830d54 100644 --- a/scsi/qemu-pr-helper.c +++ b/scsi/qemu-pr-helper.c @@ -1030,8 +1030,8 @@ int main(int argc, char **argv) server_ioc =3D qio_channel_socket_new_fd(FIRST_SOCKET_ACTIVATION_F= D, &local_err); if (server_ioc =3D=3D NULL) { - error_report("Failed to use socket activation: %s", - error_get_pretty(local_err)); + error_reportf_err(local_err, + "Failed to use socket activation: "); exit(EXIT_FAILURE); } } --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 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=1587756226; cv=none; d=zohomail.com; s=zohoarc; b=b6GZCkk3jXM4XgvHW9m2PJk2VriQOWHZkGnyHywB833NvfOVhgABbIP7MLuIEnA0Xqezus03KtSAq0GO3O1usoIXqrIC0L5WJFuA37Az/tyr7rsdmJb7XGUflkhbWiddUipB5EAx1+pDcOCE/oop3EUEYpz3tBYQDAJpm0lx6Ws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756226; 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=qD+sCyYkG+ZXcI0wwssqfE0thLMr7jzYU2lZIOHMxw0=; b=FAaJvRfJq93UIjp4m+WY5gxwJtdqZ48y8GCtmnvHq22WNGgdwytkFrZTsyx+AsJv465QFyLuzTEl8vPHMt0nBQ9DPI7hgPUP+z2AQm0PPJDMeMaR3RWYGhg9/h7QnhCWi4BGQpQEVgi43NA7yCjOFBJdetQ+eCb8YJjbAxIFUE8= 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 1587756226677548.2222193017926; Fri, 24 Apr 2020 12:23:46 -0700 (PDT) Received: from localhost ([::1]:49872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3vN-0001yf-64 for importer@patchew.org; Fri, 24 Apr 2020 15:23:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52966) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sK-0003QK-UI for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sK-00043m-Be for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40753 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sJ-000436-TK for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-208-4LBmKVBtPDmMI6GU2dAfzg-1; Fri, 24 Apr 2020 15:20:33 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F151800C78; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA10B1001281; Fri, 24 Apr 2020 19:20:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3E1E511358C3; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756035; 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=qD+sCyYkG+ZXcI0wwssqfE0thLMr7jzYU2lZIOHMxw0=; b=GLjoD7T7VZHDLSpmJvRWUDEnP8jUQntms/u6HmGFyWTgwKF+b5ZtEjBwQaU6pjHsky2ivX M3VGcEMbiy/BkLSI830tKSoMS+7X6gZtmBYQ0KS1OeBmjIMPRgJNIwFC8radArelV4yDrh rs5u2UfaI1Sc2W4QyTzIzURqhNMtWLE= X-MC-Unique: 4LBmKVBtPDmMI6GU2dAfzg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 07/11] mips/malta: Fix create_cps() error handling Date: Fri, 24 Apr 2020 21:20:23 +0200 Message-Id: <20200424192027.11404-8-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 02:57:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: Aleksandar Markovic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The Error ** argument must be NULL, &error_abort, &error_fatal, or a pointer to a variable containing NULL. Passing an argument of the latter kind twice without clearing it in between is wrong: if the first call sets an error, it no longer points to NULL for the second create_cps() is wrong that way. The last calls treats an error as fatal. Do that for the prior ones, too. Fixes: bff384a4fbd5d0e86939092e74e766ef0f5f592c Cc: Aleksandar Markovic Cc: "Philippe Mathieu-Daud=C3=A9" Cc: Aurelien Jarno Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/mips_malta.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index e4c4de1b4e..17bf41616b 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1185,17 +1185,14 @@ static void create_cpu_without_cps(MachineState *ms, static void create_cps(MachineState *ms, MaltaState *s, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { - Error *err =3D NULL; - sysbus_init_child_obj(OBJECT(s), "cps", OBJECT(&s->cps), sizeof(s->cps= ), TYPE_MIPS_CPS); - object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type", &er= r); - object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp", &err); - object_property_set_bool(OBJECT(&s->cps), true, "realized", &err); - if (err !=3D NULL) { - error_report("%s", error_get_pretty(err)); - exit(1); - } + object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type", + &error_fatal); + object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp", + &error_fatal); + object_property_set_bool(OBJECT(&s->cps), true, "realized", + &error_fatal); =20 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); =20 --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 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=1587756363; cv=none; d=zohomail.com; s=zohoarc; b=g+p2ajRhKuFMJ90BWRa0UfJ72CzGoOHVYScGMGBHUyocx9VXrJF1mVP/eYJPjXKQmKYSWgIAPEIVy1Mn7VqyUypqVg9laxuDAfX1vDbFLxp+Yze7yslQuP39wOTe5+c9vKIbxDo1GtDih9qFcm2BjtTrU657MuuZhOGAU3p09V4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756363; 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=ASZZZIyyvkJvNdyEC2tSEUSDsRRjQZ96na7DykDkrV8=; b=P8iL8/UGu1c9HuFrsbHpmLMgjvgVSn6LTLkEUANYAf6LFYSTQWbkZqqMZPBk9K3ACH1KrewYDscowgLwKYCDByfV7CEqbVO1i7VtU18YMpnaS8hJ3YI2j5opsOexMps8nY5ZVWI3YxcXIHEyWUh83F4+XBBMdrZvJa8zedp7930= 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 1587756363889422.2617190722442; Fri, 24 Apr 2020 12:26:03 -0700 (PDT) Received: from localhost ([::1]:50114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3xa-0007ir-LA for importer@patchew.org; Fri, 24 Apr 2020 15:26:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52984) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sN-0003Te-I3 for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sL-00044p-CZ for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:39 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26624 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sK-00043w-UL for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-329-t3fgFY72N3ismHaVcMdNuQ-1; Fri, 24 Apr 2020 15:20:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAE291800D42; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2B2F196AE; Fri, 24 Apr 2020 19:20:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 416DA11358C4; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756036; 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=ASZZZIyyvkJvNdyEC2tSEUSDsRRjQZ96na7DykDkrV8=; b=ShJ8l4AWk8gqnnDen0eh30yFy665gAKmJFxUqZeaHO3DPNdrKqmB54/qquawiZGcik4McE bJeCefpulCS+RjHiFp8EizvGbQpBcGm7mu/9RsXzqZXHaVzfwMOH8YoQRXzudyyQpy+uNX JNwRUZwPFMkUiiY0FK6hd2Er61IBf38= X-MC-Unique: t3fgFY72N3ismHaVcMdNuQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 08/11] mips/boston: Fix boston_mach_init() error handling Date: Fri, 24 Apr 2020 21:20:24 +0200 Message-Id: <20200424192027.11404-9-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 13:45:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Paul Burton , Aleksandar Rikalo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The Error ** argument must be NULL, &error_abort, &error_fatal, or a pointer to a variable containing NULL. Passing an argument of the latter kind twice without clearing it in between is wrong: if the first call sets an error, it no longer points to NULL for the second boston_mach_init() is wrong that way. The last calls treats an error as fatal. Do that for the prior ones, too. Fixes: df1d8a1f29f567567b9d20be685a4241282e7005 Cc: Paul Burton Cc: Aleksandar Rikalo Signed-off-by: Markus Armbruster --- hw/mips/boston.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 98ecd25e8e..2832dfa6ae 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -458,14 +458,11 @@ static void boston_mach_init(MachineState *machine) sysbus_init_child_obj(OBJECT(machine), "cps", OBJECT(&s->cps), sizeof(s->cps), TYPE_MIPS_CPS); object_property_set_str(OBJECT(&s->cps), machine->cpu_type, "cpu-type", - &err); - object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp", = &err); - object_property_set_bool(OBJECT(&s->cps), true, "realized", &err); - - if (err !=3D NULL) { - error_report("%s", error_get_pretty(err)); - exit(1); - } + &error_fatal); + object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp", + &error_fatal); + object_property_set_bool(OBJECT(&s->cps), true, "realized", + &error_fatal); =20 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); =20 --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 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=1587756461; cv=none; d=zohomail.com; s=zohoarc; b=Z3Wwpbs0Z4RzVSQMrAuNoqshkbzGBMZeu8fZNByqqlvCk6EqKFJiLGsnWan8IDr4CcJocMQ6tE5gLTuOnQPgaFX6bJULG6f0Ue5tbOlMSR55fY7MbLfi2csC46xT6FddVAtyWBHmAHbQHg81qZZOJzdGkz6/gGFCykyHfAsKWQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756461; 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=hUT/cU4Bd/vQ2eU3ozZI3eDINyvVVCGQcwfYZ9hnxlk=; b=F3pcGwGMyc2TzpPLJgBjVp+54h4b7yVes0HbvfN4CCXxQDxAKZxitN6DVDD1B0BM19LS9LYIrcxEpmTVjWmC2aFUAvPAdLIoLnVHVeutHSpplr7emMBRIl70hvK9PD3VwFiCarhT/r2VX2EJnB67fQj+uHXIzL/+FrFkzAEdbk0= 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 1587756461270318.26264950715256; Fri, 24 Apr 2020 12:27:41 -0700 (PDT) Received: from localhost ([::1]:50260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3z9-0002pS-R1 for importer@patchew.org; Fri, 24 Apr 2020 15:27:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52992) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sO-0003VF-EG for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sN-00045e-UQ for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:40 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:32892 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sN-000454-EQ for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:39 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-Fnp2PKMzPcuEGJe5uuQNuw-1; Fri, 24 Apr 2020 15:20:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2B0484B8A2; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5CD15D9CC; Fri, 24 Apr 2020 19:20:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4490F11358C5; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756037; 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=hUT/cU4Bd/vQ2eU3ozZI3eDINyvVVCGQcwfYZ9hnxlk=; b=VsV4S2lz9YOTbqh7UtpN7EjoHgBTSEdZioEmBrIIKltMlke72fc+EMyF7fy6f5cxy0vLx3 Be1yI1ZOtm3BlzBEQxvufUAVP/j9fvo/TEDqZrzvzoDc9v0Qe2oBobz552baYnosHJ3Lrc mcDnCu+FqdjfU0rqp1dywZcOhxC6Skw= X-MC-Unique: Fnp2PKMzPcuEGJe5uuQNuw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 09/11] mips/boston: Plug memory leak in boston_mach_init() Date: Fri, 24 Apr 2020 21:20:25 +0200 Message-Id: <20200424192027.11404-10-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.81; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 13:45:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Paul Burton , Aleksandar Rikalo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Fixes: df1d8a1f29f567567b9d20be685a4241282e7005 Cc: Paul Burton Cc: Aleksandar Rikalo Signed-off-by: Markus Armbruster --- hw/mips/boston.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 2832dfa6ae..a896056be1 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -426,7 +426,6 @@ static void boston_mach_init(MachineState *machine) { DeviceState *dev; BostonState *s; - Error *err =3D NULL; MemoryRegion *flash, *ddr_low_alias, *lcd, *platreg; MemoryRegion *sys_mem =3D get_system_memory(); XilinxPCIEHost *pcie2; @@ -467,7 +466,8 @@ static void boston_mach_init(MachineState *machine) sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); =20 flash =3D g_new(MemoryRegion, 1); - memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, &err); + memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, + &error_fatal); memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0); =20 memory_region_add_subregion_overlap(sys_mem, 0x80000000, machine->ram,= 0); --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 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=1587756501; cv=none; d=zohomail.com; s=zohoarc; b=HqiOz9uOkRoUZ5WX3S8pFc9RqqCzuIJSoiqFoX6Y5sAKTW2oSYQxsFDWftaUwi0LPcHLQgUZOKOTv15KzvlukoJm31G3wCEJg5P2F6ytma3PdluZKs4tLWDb9ClIoZpIF01wB6/Ri92HJaHocj1zw35eSmFglZxN+YOYb36t8Ws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756501; 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=oDUiKxCdN8lQeoLqT7wRkl74k2K9BI/Rksj2jl+zr0c=; b=Uw3OoTzpZ23+HLPMd/YXH8Ue0EMxGV5LuyUyhIJguFdyU95qd84oac1V4uPvggeqbvcBioLghMHPM841En06lN1HH22dVLM24a9vzOzyRHRw5/cTE1OWzk1m53RunQiD9r36+l2EEj02+J0022kvwv/Gzo2Hgk003dr/Brq7CQI= 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 1587756501486910.434086758202; Fri, 24 Apr 2020 12:28:21 -0700 (PDT) Received: from localhost ([::1]:50346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3zo-0004SH-5K for importer@patchew.org; Fri, 24 Apr 2020 15:28:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52980) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sM-0003SO-Te for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sM-000459-E8 for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53813 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sL-00044v-U3 for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:37 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-CL6UVSlANBCdUlQpOWxpJw-1; Fri, 24 Apr 2020 15:20:33 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 482E7107ACF2; Fri, 24 Apr 2020 19:20:32 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA43510002AA; Fri, 24 Apr 2020 19:20:31 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 48E5011358C6; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756037; 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=oDUiKxCdN8lQeoLqT7wRkl74k2K9BI/Rksj2jl+zr0c=; b=R5bvyxsCC5W2X239XYrOSmcGJ0qYD+7bGQ3EULG2Go4s2jS06A6Ect4O9Oa8PPzeAnSTbv MjbOw7MWuEApLlMxW/nTRqiFjhZNrNP4pLuAmVq6Bm4U3VG6xuTJv2OObFMaMkd/opguMr eDKR21kVHbfzAmDvaAmrLy4eUwIOwxk= X-MC-Unique: CL6UVSlANBCdUlQpOWxpJw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 10/11] arm/sabrelite: Consistently use &error_fatal in sabrelite_init() Date: Fri, 24 Apr 2020 21:20:26 +0200 Message-Id: <20200424192027.11404-11-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 15:11:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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 , Jean-Christophe Dubois Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Cc: Peter Maydell Cc: Jean-Christophe Dubois Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/sabrelite.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c index e31694bb92..04f4b96591 100644 --- a/hw/arm/sabrelite.c +++ b/hw/arm/sabrelite.c @@ -41,7 +41,6 @@ static void sabrelite_reset_secondary(ARMCPU *cpu, static void sabrelite_init(MachineState *machine) { FslIMX6State *s; - Error *err =3D NULL; =20 /* Check the amount of memory is compatible with the SOC */ if (machine->ram_size > FSL_IMX6_MMDC_SIZE) { @@ -52,11 +51,7 @@ static void sabrelite_init(MachineState *machine) =20 s =3D FSL_IMX6(object_new(TYPE_FSL_IMX6)); object_property_add_child(OBJECT(machine), "soc", OBJECT(s), &error_fa= tal); - object_property_set_bool(OBJECT(s), true, "realized", &err); - if (err !=3D NULL) { - error_report("%s", error_get_pretty(err)); - exit(1); - } + object_property_set_bool(OBJECT(s), true, "realized", &error_fatal); =20 memory_region_add_subregion(get_system_memory(), FSL_IMX6_MMDC_ADDR, machine->ram); --=20 2.21.1 From nobody Fri Nov 14 12:10:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587756130; cv=none; d=zohomail.com; s=zohoarc; b=b4ZxBoYxN6o0b1KjK/lkjiz3I2+j8FTT8R1f9tKlG0pq9qFm13YM5J63mgiw1BaRcpCkV70l9p+UMELw3Oj/ZN9vwoEIB4jiaOKP7Wd84tewCz/NaRPtf2OLW3Lo7Lpdh0AMzJL9XjOFqYzm2qkEcpDVVs31iJm2nb3mHfi/p04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587756130; 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=zGcQGQv7zwGHGWcukN+1+avvdcKa5eSElFpuJg26zW8=; b=hRyLNX0btzlmT7GF63DU0+OT9Y5QB0Ux1/FsT5NHoqxbFXfPNVFbyn5uppDihlJqrBP4MUPG4UlmuK8sIrHUguBUhuwMF3Ch4QmuKHpZ3Uy8PE/0h6ELvM+nsDdqsyzWdY8uF7cCPB/Rv2/2/bE2zdXoF0zvgJaBR3pfExI/+Js= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1587756130598357.1970290942012; Fri, 24 Apr 2020 12:22:10 -0700 (PDT) Received: from localhost ([::1]:49684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3tp-00066R-7H for importer@patchew.org; Fri, 24 Apr 2020 15:22:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53020) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jS3sV-0003jv-9X for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jS3sQ-00047P-T4 for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:37774 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jS3sQ-00045q-Et for qemu-devel@nongnu.org; Fri, 24 Apr 2020 15:20:42 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-314-IOZPIz37MWaWNTbYOZcO3A-1; Fri, 24 Apr 2020 15:20:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 443E684B8A3; Fri, 24 Apr 2020 19:20:34 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-113-6.ams2.redhat.com [10.36.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F14BA5D715; Fri, 24 Apr 2020 19:20:33 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4C2CF11358C7; Fri, 24 Apr 2020 21:20:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587756040; 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=zGcQGQv7zwGHGWcukN+1+avvdcKa5eSElFpuJg26zW8=; b=P/7nO099HFEXPbABQFI/M5guWmeEQnKbDe5ed+oIcNccj8pUNAxzXlXv4pIC/QBUqtFJ0w i8QzyyZVjQzO3CpYvmtax9y8diyhnx736uscgJcnTijkFSEFOL2NUJhhWKEcOJAzew73Sx 4yvagofrqYvE1I4NUTypHZMYzOR0xuQ= X-MC-Unique: IOZPIz37MWaWNTbYOZcO3A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH 11/11] i386: Fix x86_cpu_load_model() error API violation Date: Fri, 24 Apr 2020 21:20:27 +0200 Message-Id: <20200424192027.11404-12-armbru@redhat.com> In-Reply-To: <20200424192027.11404-1-armbru@redhat.com> References: <20200424192027.11404-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/24 15:11:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Paolo Bonzini , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The Error ** argument must be NULL, &error_abort, &error_fatal, or a pointer to a variable containing NULL. Passing an argument of the latter kind twice without clearing it in between is wrong: if the first call sets an error, it no longer points to NULL for the second call. x86_cpu_load_model() is wrong that way. Harmless, because its @errp is always &error_abort. To fix, cut out the @errp middleman. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Markus Armbruster --- target/i386/cpu.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 90ffc5f3b1..3f09fd2321 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5078,7 +5078,7 @@ static void x86_cpu_apply_version_props(X86CPU *cpu, = X86CPUModel *model) =20 /* Load data from X86CPUDefinition into a X86CPU object */ -static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model, Error **er= rp) +static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) { X86CPUDefinition *def =3D model->cpudef; CPUX86State *env =3D &cpu->env; @@ -5092,13 +5092,19 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUM= odel *model, Error **errp) */ =20 /* CPU models only set _minimum_ values for level/xlevel: */ - object_property_set_uint(OBJECT(cpu), def->level, "min-level", errp); - object_property_set_uint(OBJECT(cpu), def->xlevel, "min-xlevel", errp); + object_property_set_uint(OBJECT(cpu), def->level, "min-level", + &error_abort); + object_property_set_uint(OBJECT(cpu), def->xlevel, "min-xlevel", + &error_abort); =20 - object_property_set_int(OBJECT(cpu), def->family, "family", errp); - object_property_set_int(OBJECT(cpu), def->model, "model", errp); - object_property_set_int(OBJECT(cpu), def->stepping, "stepping", errp); - object_property_set_str(OBJECT(cpu), def->model_id, "model-id", errp); + object_property_set_int(OBJECT(cpu), def->family, "family", + &error_abort); + object_property_set_int(OBJECT(cpu), def->model, "model", + &error_abort); + object_property_set_int(OBJECT(cpu), def->stepping, "stepping", + &error_abort); + object_property_set_str(OBJECT(cpu), def->model_id, "model-id", + &error_abort); for (w =3D 0; w < FEATURE_WORDS; w++) { env->features[w] =3D def->features[w]; } @@ -5135,7 +5141,8 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUMod= el *model, Error **errp) vendor =3D host_vendor; } =20 - object_property_set_str(OBJECT(cpu), vendor, "vendor", errp); + object_property_set_str(OBJECT(cpu), vendor, "vendor", + &error_abort); =20 x86_cpu_apply_version_props(cpu, model); } @@ -6981,7 +6988,7 @@ static void x86_cpu_initfn(Object *obj) object_property_add_alias(obj, "sse4_2", obj, "sse4.2", &error_abort); =20 if (xcc->model) { - x86_cpu_load_model(cpu, xcc->model, &error_abort); + x86_cpu_load_model(cpu, xcc->model); } } =20 --=20 2.21.1