qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] baum: Fix crash when Braille output is not available
@ 2021-03-10 16:08 Samuel Thibault
  2021-03-10 17:18 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Samuel Thibault @ 2021-03-10 16:08 UTC (permalink / raw)
  To: qemu-devel, peter.maydell; +Cc: Samuel Thibault

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 <samuel.thibault@ens-lyon.org>
---
 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 = BAUM_CHARDEV(obj);
 
-    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);
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-30 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10 16:08 [PATCH] baum: Fix crash when Braille output is not available Samuel Thibault
2021-03-10 17:18 ` Peter Maydell
2021-03-10 17:19   ` Samuel Thibault
2021-03-10 17:23 ` Thomas Huth
2021-04-30 17:01   ` Laurent Vivier
2021-04-30 17:07     ` Laurent Vivier
2021-03-10 17:23 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).