Commit a75bf146 authored by Amit Shah's avatar Amit Shah
Browse files

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: default avatarAmit Shah <amit.shah@redhat.com>
parent bdb917bf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
    }