From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7037C433DF for ; Mon, 6 Jul 2020 14:48:29 +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 793FA2070C for ; Mon, 6 Jul 2020 14:48:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 793FA2070C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsSQ0-0007HI-P6 for qemu-devel@archiver.kernel.org; Mon, 06 Jul 2020 10:48:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsSPQ-0006lL-ML for qemu-devel@nongnu.org; Mon, 06 Jul 2020 10:47:52 -0400 Received: from 2.mo7.mail-out.ovh.net ([87.98.143.68]:59601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsSPO-0005ak-Ly for qemu-devel@nongnu.org; Mon, 06 Jul 2020 10:47:52 -0400 Received: from player746.ha.ovh.net (unknown [10.110.171.212]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 16D3216C05D for ; Mon, 6 Jul 2020 16:47:47 +0200 (CEST) Received: from kaod.org (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player746.ha.ovh.net (Postfix) with ESMTPSA id 74122142C097B; Mon, 6 Jul 2020 14:47:35 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-97G002ce60e467-0f47-46ed-b716-d5a23460f8be,C4ABCEF356A601883B7DEB1AA4190402CFF29AFD) smtp.auth=groug@kaod.org Date: Mon, 6 Jul 2020 16:47:34 +0200 From: Greg Kurz To: Markus Armbruster Subject: Re: [PATCH v3 04/44] macio: Tidy up error handling in macio_newworld_realize() Message-ID: <20200706164734.00d1e59d@bahia.lan> In-Reply-To: <20200706080950.403087-5-armbru@redhat.com> References: <20200706080950.403087-1-armbru@redhat.com> <20200706080950.403087-5-armbru@redhat.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 4148659685527493006 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedrudefgdekfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkjghfofggtgfgsehtjeertdertddvnecuhfhrohhmpefirhgvghcumfhurhiiuceoghhrohhugheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeehkefhtdehgeehheejledufeekhfdvleefvdeihefhkefhudffhfeuuedvffdthfenucfkpheptddrtddrtddrtddpkedvrddvheefrddvtdekrddvgeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjeegiedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehgrhhouhhgsehkrghougdrohhrghdprhgtphhtthhopehqvghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhg Received-SPF: pass client-ip=87.98.143.68; envelope-from=groug@kaod.org; helo=2.mo7.mail-out.ovh.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 10:47:48 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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@linaro.org, vsementsov@virtuozzo.com, berrange@redhat.com, ehabkost@redhat.com, qemu-block@nongnu.org, Mark Cave-Ayland , qemu-devel@nongnu.org, pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 6 Jul 2020 10:09:10 +0200 Markus Armbruster wrote: > macio_newworld_realize() effectively ignores ns->gpio realization > errors, leaking the Error object. Fortunately, macio_gpio_realize() > can't actually fail. Tidy up. > > Cc: Mark Cave-Ayland > Cc: David Gibson > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > Acked-by: David Gibson > Reviewed-by: Vladimir Sementsov-Ogievskiy > --- Reviewed-by: Greg Kurz > hw/misc/macio/macio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c > index 42414797e2..be66bb7758 100644 > --- a/hw/misc/macio/macio.c > +++ b/hw/misc/macio/macio.c > @@ -334,7 +334,9 @@ static void macio_newworld_realize(PCIDevice *d, Error **errp) > &error_abort); > memory_region_add_subregion(&s->bar, 0x50, > sysbus_mmio_get_region(sysbus_dev, 0)); > - qdev_realize(DEVICE(&ns->gpio), BUS(&s->macio_bus), &err); > + if (!qdev_realize(DEVICE(&ns->gpio), BUS(&s->macio_bus), errp)) { > + return; > + } > > /* PMU */ > object_initialize_child(OBJECT(s), "pmu", &s->pmu, TYPE_VIA_PMU);