From patchwork Fri Dec 13 16:18:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11291349 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2727C14E3 for ; Fri, 13 Dec 2019 21:23:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF4ED2465A for ; Fri, 13 Dec 2019 21:23:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PNLwoK0g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF4ED2465A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifnrq-0000dm-1w for patchwork-qemu-devel@patchwork.kernel.org; Fri, 13 Dec 2019 11:32:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40134) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifnfH-0000cO-W0 for qemu-devel@nongnu.org; Fri, 13 Dec 2019 11:19:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifnfG-0001qJ-RK for qemu-devel@nongnu.org; Fri, 13 Dec 2019 11:19:39 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:23366 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ifnfG-0001pB-Nl for qemu-devel@nongnu.org; Fri, 13 Dec 2019 11:19:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576253978; 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=kQR2sdSqZ9cEX9aPchrW/IDdW8VYKLN4r4CJI+RiiHM=; b=PNLwoK0gdSsUMrEikHz2m+lBW9ZTKo0mK76BCm3X4PXRPgzEGillokRrF00r4u+m4m8Ucc RUki7l4ypncIx0IO1ARSTq9cH6ElzelNo998+/7dRfweFM1zZCuyjpbt26RMA5lLoEkoek 2sA2BjWJyel8CfUVgxz93TCWdjONYvc= 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-69-JCZmTUviOqyEaf0LmEUlqw-1; Fri, 13 Dec 2019 11:19:36 -0500 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 C63918014C1; Fri, 13 Dec 2019 16:19:34 +0000 (UTC) Received: from localhost (ovpn-116-226.ams2.redhat.com [10.36.116.226]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68315601B6; Fri, 13 Dec 2019 16:19:34 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Subject: [PULL 10/16] s390x/event-facility: Fix realize() error API violations Date: Fri, 13 Dec 2019 17:18:45 +0100 Message-Id: <20191213161851.24687-11-cohuck@redhat.com> In-Reply-To: <20191213161851.24687-1-cohuck@redhat.com> References: <20191213161851.24687-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: JCZmTUviOqyEaf0LmEUlqw-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/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 , qemu-s390x@nongnu.org, David Hildenbrand , qemu-devel@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Markus Armbruster sclp_events_bus_realize() dereferences @errp when object_property_set_bool() fails. That's wrong; see the big comment in error.h. Introduced in commit f6102c329c "s390/sclp: rework sclp event facility initialization + device realization". No caller actually passes null. Fix anyway: splice in a local Error *err, and error_propagate(). Cc: David Hildenbrand Cc: Cornelia Huck Signed-off-by: Markus Armbruster Reviewed-by: David Hildenbrand Message-Id: <20191204093625.14836-12-armbru@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/event-facility.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 66205697ae75..cdcf9154c49e 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -339,14 +339,16 @@ out: static void sclp_events_bus_realize(BusState *bus, Error **errp) { + Error *err = NULL; BusChild *kid; /* TODO: recursive realization has to be done in common code */ QTAILQ_FOREACH(kid, &bus->children, sibling) { DeviceState *dev = kid->child; - object_property_set_bool(OBJECT(dev), true, "realized", errp); - if (*errp) { + object_property_set_bool(OBJECT(dev), true, "realized", &err); + if (errp) { + error_propagate(errp, err); return; } }