qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: "QEMU Trivial" <qemu-trivial@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH] baum: Fix crash when Braille output is not available
Date: Wed, 10 Mar 2021 18:23:15 +0100	[thread overview]
Message-ID: <8624f8c8-d541-051a-13f6-f05d685fefde@redhat.com> (raw)
In-Reply-To: <20210310160815.3411019-1-samuel.thibault@ens-lyon.org>

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>



  parent reply	other threads:[~2021-03-10 17:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-04-30 17:01   ` Laurent Vivier
2021-04-30 17:07     ` Laurent Vivier
2021-03-10 17:23 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8624f8c8-d541-051a-13f6-f05d685fefde@redhat.com \
    --to=thuth@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).