From nobody Wed Nov 19 07:25:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1615394281; cv=none; d=zohomail.com; s=zohoarc; b=BbhTA4adL6ZsabrWwM9cVZIdB4Qaxz4b5pYQvCS40+AKDVAaHjtCID1U2CX4RvJ8FwJ1kk//+Rklak877Zd2iEP4yQFagN9eZpD/j/FW7ZRII3R0in61vWx3m3tEStyBhhaaIqTMpRaZA2XqiJ3PWA54qWqe/7XILLPqqPyEu8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615394281; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=0VFvUfRCz8h6nhHqvNat0ZjdvhQ8KxHREMewA3RscgE=; b=dwHXql4fTw8qTxuN3y4wW8Yu6YjQRp9wnrGLY2qPHK4LlMY7hdrhq7Vfa759p0yWR9CAy3pPsYn7prs2a5vm55kLnCaOlyX6Z4ABf6otCJ5UnMGuvGm9sZihM+bXkwJugXJTmQ+QTHFmROtOl6O78O6FhNgN3pKTkq2QO9ET410= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1615394281223362.7282720927909; Wed, 10 Mar 2021 08:38:01 -0800 (PST) Received: from localhost ([::1]:47820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK1qS-0006lA-8g for importer@patchew.org; Wed, 10 Mar 2021 11:38:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK1Np-0002dd-6e for qemu-devel@nongnu.org; Wed, 10 Mar 2021 11:08:25 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:38690) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK1Nm-0006Zk-KY for qemu-devel@nongnu.org; Wed, 10 Mar 2021 11:08:24 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E18A218E; Wed, 10 Mar 2021 17:08:17 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wPbAUFdBDCYn; Wed, 10 Mar 2021 17:08:17 +0100 (CET) Received: from begin.home (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 478E9AC; Wed, 10 Mar 2021 17:08:17 +0100 (CET) Received: from samy by begin.home with local (Exim 4.94) (envelope-from ) id 1lK1Nf-00EJNC-T8; Wed, 10 Mar 2021 17:08:15 +0100 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr From: Samuel Thibault To: qemu-devel@nongnu.org, peter.maydell@linaro.org Subject: [PATCH] baum: Fix crash when Braille output is not available Date: Wed, 10 Mar 2021 17:08:15 +0100 Message-Id: <20210310160815.3411019-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Rspamd-Server: hera Authentication-Results: hera.aquilenet.fr X-Rspamd-Queue-Id: E18A218E X-Spamd-Result: default: False [5.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(0.00)[19.23%]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_MISSING_CHARSET(2.50)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_COUNT_THREE(0.00)[3]; MID_CONTAINS_FROM(1.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[] 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; Received-SPF: neutral client-ip=185.233.100.1; envelope-from=samuel.thibault@ens-lyon.org; helo=hera.aquilenet.fr X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no 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: Samuel Thibault Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" When Braille output is not available, the backend properly reports being unable to be created, but 5f8e93c3e262 ("util/qemu-timer: Make timer_free() imply timer_del()") made the timer_free() call now refuse any NULL parameter. char_braille_finalize thus now has to be more careful with calling it on baum->cellCount_timer. Signed-off-by: Samuel Thibault Reviewed-by: Thomas Huth --- chardev/baum.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chardev/baum.c b/chardev/baum.c index 5deca778bc..aca5bf12fb 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -631,7 +631,9 @@ static void char_braille_finalize(Object *obj) { BaumChardev *baum =3D BAUM_CHARDEV(obj); =20 - timer_free(baum->cellCount_timer); + if (baum->cellCount_timer) { + timer_free(baum->cellCount_timer); + } if (baum->brlapi) { brlapi__closeConnection(baum->brlapi); g_free(baum->brlapi); --=20 2.30.1