qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1 4/9] msmouse: add appropriate unregister handler


From: Marc-André Lureau
Subject: Re: [PATCH v1 4/9] msmouse: add appropriate unregister handler
Date: Tue, 29 Mar 2022 12:13:37 +0400

On Tue, Mar 29, 2022 at 1:15 AM Maxim Davydov <maxim.davydov@openvz.org> wrote:
>
> Attempt to finalize msmouse after initalization brings to segmentation
> fault in QTAILQ_REMOVE.
>
> Signed-off-by: Maxim Davydov <maxim.davydov@openvz.org>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  chardev/msmouse.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/chardev/msmouse.c b/chardev/msmouse.c
> index eb9231dcdb..2cc1b16561 100644
> --- a/chardev/msmouse.c
> +++ b/chardev/msmouse.c
> @@ -146,7 +146,9 @@ static void char_msmouse_finalize(Object *obj)
>  {
>      MouseChardev *mouse = MOUSE_CHARDEV(obj);
>
> -    qemu_input_handler_unregister(mouse->hs);
> +    if (mouse->hs) {
> +        qemu_input_handler_unregister(mouse->hs);
> +    }
>  }
>
>  static QemuInputHandler msmouse_handler = {
> --
> 2.31.1
>




reply via email to

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