Skip to content

Commit

Permalink
virtio-serial: delete timer if active during exit
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
amit3s committed Dec 13, 2012
1 parent bdb917b commit a75bf14
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/virtio-serial-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a75bf14

Please sign in to comment.