mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
769a726ccb
commit
fc0c128531
2 changed files with 6 additions and 2 deletions
|
@ -319,7 +319,9 @@ static void wctablet_chr_finalize(Object *obj)
|
|||
{
|
||||
TabletChardev *tablet = WCTABLET_CHARDEV(obj);
|
||||
|
||||
qemu_input_handler_unregister(tablet->hs);
|
||||
if (tablet->hs) {
|
||||
qemu_input_handler_unregister(tablet->hs);
|
||||
}
|
||||
}
|
||||
|
||||
static void wctablet_chr_open(Chardev *chr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue