virtio-serial: delete timer if active during exit

The post_load timer was being freed, but not deleted.  This could cause
problems when the timer is armed, but the device is hot-unplugged before
the callback is executed.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
This commit is contained in:
Amit Shah 2012-12-13 15:54:43 +05:30
parent bdb917bf8a
commit a75bf14650

View file

@ -1038,6 +1038,7 @@ void virtio_serial_exit(VirtIODevice *vdev)
g_free(vser->ports_map);
if (vser->post_load) {
g_free(vser->post_load->connected);
qemu_del_timer(vser->post_load->timer);
qemu_free_timer(vser->post_load->timer);
g_free(vser->post_load);
}