From patchwork Wed Jul 25 11:30:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10543871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5A971822 for ; Wed, 25 Jul 2018 11:31:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5D45299E9 for ; Wed, 25 Jul 2018 11:31:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99C8129AD4; Wed, 25 Jul 2018 11:31:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D465299E9 for ; Wed, 25 Jul 2018 11:31:08 +0000 (UTC) Received: from localhost ([::1]:48242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiI0Z-0000ho-El for patchwork-qemu-devel@patchwork.kernel.org; Wed, 25 Jul 2018 07:31:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fiHze-0008Ap-Qf for qemu-devel@nongnu.org; Wed, 25 Jul 2018 07:30:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fiHzb-0000TL-RA for qemu-devel@nongnu.org; Wed, 25 Jul 2018 07:30:10 -0400 Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:58038) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fiHzb-0000Ji-L8 for qemu-devel@nongnu.org; Wed, 25 Jul 2018 07:30:07 -0400 Received: from ramsan.of.borg ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id EzW21y00a3XaVaC01zW2S9; Wed, 25 Jul 2018 13:30:04 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fiHzW-00020y-BX; Wed, 25 Jul 2018 13:30:02 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1fiHzW-0002sQ-9X; Wed, 25 Jul 2018 13:30:02 +0200 From: Geert Uytterhoeven To: Peter Maydell , Eric Auger Date: Wed, 25 Jul 2018 13:30:00 +0200 Message-Id: <20180725113000.11014-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2a02:1800:120:4::f00:14 Subject: [Qemu-devel] [PATCH] hw/arm/sysbus-fdt: Fix assertion in copy_properties_from_host() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-renesas-soc@vger.kernel.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, Geert Uytterhoeven Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When copy_properties_from_host() ignores the error for an optional property, it frees the error, but fails to reset it. Hence if two or more optional properties are missing, an assertion is triggered: util/error.c:57: error_setv: Assertion `*errp == NULL' failed. Fis this by resetting err to NULL after ignoring the error. Fixes: 9481cf2e5f2f2bb6 ("hw/arm/sysbus-fdt: helpers for clock node generation") Signed-off-by: Geert Uytterhoeven --- hw/arm/sysbus-fdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c index 0d4c75702c3ddfae..43d6a7bb48ddc351 100644 --- a/hw/arm/sysbus-fdt.c +++ b/hw/arm/sysbus-fdt.c @@ -107,6 +107,7 @@ static void copy_properties_from_host(HostProperty *props, int nb_props, /* mandatory property not found: bail out */ exit(1); } + err = NULL; } } }