From patchwork Mon Nov 6 11:03:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 741348 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1028512wrr; Mon, 6 Nov 2023 03:21:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmqRnGnRGmxdjrisuMpgTbJV8JalEWSoz4/KggBkLkS8FsQo1nMnkz6XOAslsGBemp76x1 X-Received: by 2002:a05:622a:cf:b0:418:111e:790f with SMTP id p15-20020a05622a00cf00b00418111e790fmr35797771qtw.65.1699269695801; Mon, 06 Nov 2023 03:21:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699269695; cv=none; d=google.com; s=arc-20160816; b=dv8Ankea5vcVlJ9Q40cU1A64QtMxqH0coSZozh0+22elWAxORJhmYmXhCZyvs/qKvg x+brzmpYOATQl0bIJH8ytbwlP7qvM5EA7go881noYpZgG6l6hhmfb12hyNtciUKQpEye lrNADGBclC93/vXDtgLg9Mtrry3pEKTz+9yNoVHiJ/9jR/goVli6jRK2lVJj0wHhj52P GQc2dErRE4M/ADZsmhdVVCFnKXekRGxGxlg3avZgL3WJghTcusg86yLWDnWjULbfdGi7 v4qWGV5YHSM3kamnR5JNIJIKoIOtJDpFmF4vYAW3NRu7uA285LBDlx/ZKrfrSQogpzxI 96Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bC2TdykjktUVtXbtq0twsr6zjowOcVE1/YbXmtopUl4=; fh=kP45t4pKNiiTQmfRdGnr9XVYBc4zhof3GMRpciaSK0k=; b=g+HsmZQb/P2AEoG42JmNvvrDvnjPokaGpfbkLG1mn4bP6VjZUeP6qg7Ra1jry/y63j pVJW3gw4vr3m8Fa9d8JmLl6XHL1YJpDZ/g93cDRQiHODYzo7HgVKSr2Xr/7biyhHINwl 1InwX5IYBw5WqHBfVkqod88BOemEr+dlFFZepozj7w1iLZMG5dXteEoTv0e07oqBJCMb AvcVv3wfPdm+Fse0xXbfNn4kc8z13IeeWWSyRehzu0OHvwdGHy2ixOYaGO+75WHuAdsy 9GWnoOMRbg2NvkoB+dkN3Yi/c6VL0CaV81jPtpgf3zCUZZ8ntPnJwnP3iIxMA9eJOFOA wZOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mHPVzGz0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b7-20020ac85bc7000000b0041020b894b6si5594099qtb.101.2023.11.06.03.21.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 03:21:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mHPVzGz0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzxTB-0006Xg-48; Mon, 06 Nov 2023 06:08:38 -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 1qzxT9-0006W0-MQ for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:35 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qzxT2-0005Ab-S8 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 06:08:34 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-32fbf271346so1513617f8f.1 for ; Mon, 06 Nov 2023 03:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699268906; x=1699873706; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bC2TdykjktUVtXbtq0twsr6zjowOcVE1/YbXmtopUl4=; b=mHPVzGz0la7J3gPwaYN9JcS8YoNnrPxizKfKyAiyR8FBBwPBFkAK0LqLpL9vxM3x26 skSRMcQv+VlS0LvrGI39tAE7O5SJtdp4myb9vGlTPR0AVpRt7FMUh5yrJFQb9qXccclB x4cfpaNZZuxegEseqrpLTMnHSyLdj3qhPWYVcbaLLNNsBYOE/KEm1VqC8qbTVg2CODwV 4Blut9SNADfSFuiggogXH51r3oJzbq8jUnvVictKW2SbpaymwU79Yt5z3V0bc5uSGqG9 l5HHDyi/ooSVGROYavcrVnHtpgI27YwG6TUcJiW+PIMpOedLp9/P6XVpiX5SWC489O5z xtXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699268906; x=1699873706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bC2TdykjktUVtXbtq0twsr6zjowOcVE1/YbXmtopUl4=; b=Y0F4lxbvF1SE1w8Z63TC/zyn5yQu9mPm98dWTVj6IVjvqUuZZi0DZJE2uqNh0fbXjw HaZQ6+jnaWHT2oxdOAxgNg7qccel6zTpqw5rj5Bx+vcIW0mOyon1oTWku4IgYtaW/69u mqXaCmrtfKWuBrcunP8DPgVDI6Xyb37P7hV4AbbqrJhIgw7q+KytdtcpRS2h5Si0iUIR 9bdMg/Jy3B2w1PcVF4vP3QvFglfgig2/2nUp8z7HK+Jc9iJ/il/lLFB2CLInhnDNewr7 TbIbyhQ/p53brYYbNsqbdF2ACV+6SznqI25cIdlLi6gKcNr4Cax2cGgrk9LrKbqCtf6o MHzQ== X-Gm-Message-State: AOJu0YyuIgbxb2bA4r1cmVdfxwj0IIrCxj13/o472+46lq3/FEfC66d3 KgRZd/o4W/RQw/2P0/q3p+axTMwzAs77segiATs= X-Received: by 2002:a5d:62cd:0:b0:32c:c35c:2eea with SMTP id o13-20020a5d62cd000000b0032cc35c2eeamr17839736wrv.6.1699268906698; Mon, 06 Nov 2023 03:08:26 -0800 (PST) Received: from m1x-phil.lan (176-131-220-199.abo.bbox.fr. [176.131.220.199]) by smtp.gmail.com with ESMTPSA id m1-20020a056000180100b0031980783d78sm9136370wrh.54.2023.11.06.03.08.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Nov 2023 03:08:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bernhard Beschow , Markus Armbruster , Richard Henderson , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= Subject: [PULL 42/60] hw/isa/i82378: Propagate error if PC_SPEAKER device creation failed Date: Mon, 6 Nov 2023 12:03:14 +0100 Message-ID: <20231106110336.358-43-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106110336.358-1-philmd@linaro.org> References: <20231106110336.358-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In commit 40f8214fcd ("hw/audio/pcspk: Inline pcspk_init()") we neglected to give a change to the caller to handle failed device creation cleanly. Respect the caller API contract and propagate the error if creating the PC_SPEAKER device ever failed. This avoid yet another bad API use to be taken as example and copy / pasted all over the code base. Reported-by: Bernhard Beschow Suggested-by: Markus Armbruster Reviewed-by: Richard Henderson Reviewed-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231020171509.87839-5-philmd@linaro.org> --- hw/isa/i82378.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 79ffbb52a0..203b92c264 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -105,7 +105,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp) /* speaker */ pcspk = isa_new(TYPE_PC_SPEAKER); object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fatal); - isa_realize_and_unref(pcspk, isabus, &error_fatal); + if (!isa_realize_and_unref(pcspk, isabus, errp)) { + return; + } /* 2 82C37 (dma) */ isa_create_simple(isabus, "i82374");