mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:56:38 +00:00
The QIONetListener mutex is initialized in the convenience
constructor qio_net_listener_new() rather than in an instance_init.
This means a bare object_new(TYPE_QIO_NET_LISTENER) produces an
object with an uninitialized mutex, but instance_finalize
unconditionally calls qemu_mutex_destroy() on it, which aborts.
Move the mutex initialization to a proper instance_init so that init
and finalize are always paired regardless of how the object is
created.
Fixes: 9d86181874 ("qio: Protect NetListener callback with mutex")
Cc: peterx@redhat.com
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>