From nobody Mon Feb 9 22:38:13 2026 Delivered-To: importer@patchew.org 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1586732577; cv=none; d=zohomail.com; s=zohoarc; b=g/eoX3jlIKiwMDJtQrdsEg4oMOSwSAGmt5fsjfTJ3YidHFeT2X36Sywrhn4RKrACXrTThPRstXn983oQH4SxHH6wZk/IJxKRKJiUGZ7Hfeh9Y9eU6LGggweEdt1r+RNNIfV6xjyL4wD32CZN+/8lqS7QdCS5o9F1MBbnaINOqIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586732577; 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=Er1m8ZT5D0yuOThtBE21KXgphcgOWZp5CA+pNN6Nq54=; b=OZyzBQDnCinGKnuUFNXA45Q/ZrB3koahIXz/LzX7IOV91bQT335zur1yxrXXgxuU4ZoU5geLsyRNyJoTmM7c2aOUNfBtPSi6FIxBLjJ/AVOlJ/FTAbHXV2k/pI92Z1d+pPuEZDl06ryQdCywRnRx8zFDUoCx+5ln4YsAH/nABg8= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586732577066631.1915657635233; Sun, 12 Apr 2020 16:02:57 -0700 (PDT) Received: from localhost ([::1]:38434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNlct-0007an-Ox for importer@patchew.org; Sun, 12 Apr 2020 19:02:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50222) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jNlJZ-0002F6-JX for qemu-devel@nongnu.org; Sun, 12 Apr 2020 18:42:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jNlJY-0006Kk-Jr for qemu-devel@nongnu.org; Sun, 12 Apr 2020 18:42:57 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:34974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jNlJY-0006KJ-Ds; Sun, 12 Apr 2020 18:42:56 -0400 Received: by mail-wm1-x343.google.com with SMTP id r26so8426973wmh.0; Sun, 12 Apr 2020 15:42:56 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id f63sm12083825wma.47.2020.04.12.15.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Apr 2020 15:42:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Er1m8ZT5D0yuOThtBE21KXgphcgOWZp5CA+pNN6Nq54=; b=Q/QpzHGYYeJh0GHGJydDYIzh6+3MTb8kq0jigm8qpafh6yu/Qc4R6Mt9ctMb22UNeA AlG76RShitrt1Kpk93ALb+rykdzvCLIwH+ZVzdG9z0jvMpU8+QLqxkGS98CShtbZceIl qROd838/+PrKbMFbcN/yAzt0BLnfd6WUHty+lEdLYh0wNK4UxMwP4afprd4gqZS2RaQg x0QQyZyQjkBfQycR30Kj8clyY2Adxy77jig48nxXFzQgYmz4Vv6L9FCuRjzVcI4KLz2T NxQNXtweW84xzSPgsRRhcfLbmuAF3UTsBBa1eKp4ngYZxa9ynRKtlO/g/aFcQKLbkG4e csnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Er1m8ZT5D0yuOThtBE21KXgphcgOWZp5CA+pNN6Nq54=; b=DsPrfj6HZyEf5sVmkh030QiBJtWh34URJ9bWFrCtZ6jQQ5JUoOUkGF0JScFcLX2vHL tm5LYvKZXsknHNNv8yUhGela1SDywdy9TcECMHmTaH6qanyDfInKwEjB7MSAubbk22ow uiHPKbilaGo3E6ABtmkcNrCn25BrNcjPsYohYp60wfq+TkSdU7RyQbCwbt29W5dasaa4 nVIfdeMv/bWkWDKGpzso8WQBBfKDP/VUCISRavQ1l0zj7//gQH3WucXoRWt6gGH/+Ote OI/4L7UJjktVR84daYKJSDnofHV7pIpE9XPh982wbGhZ7pfiUgTB8HPcL1YxEXhljj2x qhlQ== X-Gm-Message-State: AGi0PuYfRTHkVvHqOEzQxSigoIoaOX/IWGzW2CKa521bKk/Zd5CI6CdB M+xLFmd62ZdLJ4e7k05OL0+lCIs9rFIVOg== X-Google-Smtp-Source: APiQypL1Ud9LUaP8CFz+7fPskmRhArkYJ2UuySTVQQ5TUCFd06fwReoLtd89QNjkVFQ3Fkmnei43+g== X-Received: by 2002:a1c:2e91:: with SMTP id u139mr124653wmu.18.1586731375230; Sun, 12 Apr 2020 15:42:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 18/23] hw/i386/x86: Add missing error-propagation code Date: Mon, 13 Apr 2020 00:41:39 +0200 Message-Id: <20200412224144.12205-19-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200412224144.12205-1-f4bug@amsat.org> References: <20200412224144.12205-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 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 , Sagar Karandikar , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , Alistair Francis , "Edgar E. Iglesias" , Subbaraya Sundeep , qemu-block@nongnu.org, Markus Armbruster , Aleksandar Markovic , Max Reitz , Joel Stanley , Palmer Dabbelt , Aleksandar Rikalo , David Gibson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Alistair Francis , Beniamino Galvani , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Richard Henderson , Kevin Wolf , qemu-riscv@nongnu.org, Andrew Jeffery , Bastian Koppelmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Andrew Baumann , Jean-Christophe Dubois , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Running the coccinelle script: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/add-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir hw inserted a block after object_property_set_uint("apic-id") which calls error_propagate() and return. Thanksfully code review noticed returning here would skip the 'object_unref(cpu)' call. Manually fix the error propagation code by adding a label to the existing call. Reported-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/x86.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index b82770024c..ec807ce94f 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -124,8 +124,12 @@ void x86_cpu_new(X86MachineState *x86ms, int64_t apic_= id, Error **errp) cpu =3D object_new(MACHINE(x86ms)->cpu_type); =20 object_property_set_uint(cpu, apic_id, "apic-id", &local_err); + if (local_err) { + goto out; + } object_property_set_bool(cpu, true, "realized", &local_err); =20 +out: object_unref(cpu); error_propagate(errp, local_err); } --=20 2.21.1