chardev: fix segfault in finalize
commitfc0c128531ed55f058bfbad4f1348ebd9a0187f2
authorMaksim Davydov <davydov-max@yandex-team.ru>
Thu, 25 Aug 2022 16:52:47 +0000 (25 19:52 +0300)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 29 Sep 2022 10:38:05 +0000 (29 14:38 +0400)
tree95223697bf9321195928c7e9d59b9c5f52392dcf
parent769a726ccb9a8ab9b2a05bca648c79b3f80ab8de
chardev: fix segfault in finalize

If finalize chardev-msmouse or chardev-wctable is called immediately after
init it cases QEMU to crash with segfault. This happens because of
QTAILQ_REMOVE in qemu_input_handler_unregister tries to dereference
NULL pointer.
For instance, this error can be reproduced via `qom-list-properties`
command.

Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20220825165247.33704-1-davydov-max@yandex-team.ru>
chardev/msmouse.c
chardev/wctablet.c