qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] baum: Fix crash when Braille output is not available


From: Thomas Huth
Subject: Re: [PATCH] baum: Fix crash when Braille output is not available
Date: Wed, 10 Mar 2021 18:23:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 10/03/2021 17.08, Samuel Thibault wrote:
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);

I just tried to debug this problem, too, and came to the same conclusion.

Reviewed-by: Thomas Huth <thuth@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]